Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Projector Screen Bundle Laravel Package

bibsdb/projector-screen-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. Installation Add the repository to composer.json under "repositories":

    "repositories": {
      "bibsdb/projector-screen-bundle": {
        "type": "vcs",
        "url": "https://github.com/bibsdb/projector-screen-bundle"
      }
    }
    

    Require the bundle:

    composer require bibsdb/projector-screen-bundle
    
  2. Enable the Bundle Register the bundle in config/bundles.php (Laravel 5.4+) or AppKernel.php (older versions):

    Bibsdb\ProjectorScreenBundle\BibsdbProjectorScreenBundle::class => ['all' => true],
    
  3. Load the Template Run the console command to load the slide template:

    php artisan bibsdb:core:templates:load
    
  4. Enable in Admin Activate the template in the administration panel (check the bundle’s docs for the exact UI steps).


First Use Case

Embed a Projector-Screen Video in a Slide Use the bundle’s Twig template to embed a video from projector-screen.com. Example:

{# In your Twig template #}
{{ projector_screen('YOUR_VIDEO_ID', {
    'title': 'Your Video Title',
    'description': 'Video description',
    'width': 800,
    'height': 600
}) }}

Replace YOUR_VIDEO_ID with the ID of a video hosted on Projector-Screen (ensure it’s from a PLUS account to disable ads/controls).


Implementation Patterns

Workflows

  1. Dynamic Video Embedding Fetch video IDs from a database and render them dynamically:

    {% for video in videos %}
      {{ projector_screen(video.id, {
          'title': video.title,
          'width': video.width || 800,
          'height': video.height || 600
      }) }}
    {% endfor %}
    
  2. Customizing Player Options Pass additional options to the JavaScript player via the options key:

    {{ projector_screen('VIDEO_ID', {
        'options': {
            'autoplay': true,
            'muted': true,
            'controls': false  # Requires PLUS account
        }
    }) }}
    
  3. Integration with Slide Management Use the bundle’s template system to create slides in a CMS-like workflow:

    • Store slide data in a database (e.g., slides table with video_id, title, order).
    • Loop through slides in a Twig template and render each with projector_screen().

Integration Tips

  • Asset Management The bundle likely includes CSS/JS assets. Ensure they’re published and compiled:

    php artisan bibsdb:core:assets:install
    npm run dev  # or `npm run prod` for production
    
  • Localization If the bundle supports translations, load them in config/app.php:

    'bibsdb.projector-screen' => [
        'locale' => 'en', // or your preferred locale
    ],
    
  • Event Listeners Hook into the bundle’s events (if documented) to extend functionality, e.g.,:

    // In a service provider
    $this->app->boot(function () {
        event(new \Bibsdb\ProjectorScreenBundle\Event\TemplateLoadedEvent());
    });
    

Gotchas and Tips

Pitfalls

  1. Ads/Controls Not Disabled

    • Issue: Videos may show ads or controls if not from a PLUS account on projector-screen.com.
    • Fix: Ensure all embedded videos are from a PLUS account or use the controls: false option (PLUS required).
  2. Template Not Loading

    • Issue: bibsdb:core:templates:load fails silently.
    • Debug: Check the bundle’s logs or run with -vvv:
      php artisan bibsdb:core:templates:load -vvv
      
    • Fix: Verify the template files exist in the bundle’s Resources/views/ directory.
  3. Asset Conflicts

    • Issue: CSS/JS conflicts with other bundles.
    • Fix: Override assets by publishing them first:
      php artisan vendor:publish --tag=projector-screen-assets
      
      Then customize the published files in resources/public/bundles/bibsdbprojectorscreen/.

Debugging

  • Check Video ID Validity Ensure YOUR_VIDEO_ID is correct and the video exists on projector-screen.com. Test the URL directly in a browser.

  • Console Command Errors If bibsdb:core:templates:load fails, inspect the bundle’s Command class (e.g., Bibsdb\ProjectorScreenBundle\Command\LoadTemplatesCommand) for clues.


Extension Points

  1. Custom Player Configuration Extend the player’s JavaScript by overriding the bundle’s assets:

    // In a custom JS file
    window.ProjectorScreenPlayer = window.ProjectorScreenPlayer || {};
    window.ProjectorScreenPlayer.defaults = {
        ...window.ProjectorScreenPlayer.defaults,
        customOption: true
    };
    
  2. Twig Extensions Create a custom Twig extension to wrap projector_screen() with additional logic:

    // In a service provider
    $twig->addFunction(new \Twig\TwigFunction('custom_projector_screen', function ($id, $options) {
        // Pre-process $options or $id
        return \Bibsdb\ProjectorScreenBundle\Twig\ProjectorScreenExtension::render($id, $options);
    }));
    
  3. Database Integration Store slide configurations in a database and hydrate them into the template:

    // Example controller
    public function showSlide(Slide $slide) {
        return view('slides/show', [
            'videoId' => $slide->video_id,
            'options' => json_decode($slide->options, true),
        ]);
    }
    

Configuration Quirks

  • Default Options The bundle may have default options (e.g., width, height). Override them in your Twig call:

    {{ projector_screen('VIDEO_ID', {
        'width': 1024,
        'height': 768
    }) }}
    
  • Caching If videos fail to load, clear Laravel’s cache:

    php artisan cache:clear
    php artisan view:clear
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php
trappistes/laravel-custom-fields
splash/sonata-admin
splash/metadata