bibsdb/projector-screen-bundle
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
Enable the Bundle
Register the bundle in config/bundles.php (Laravel 5.4+) or AppKernel.php (older versions):
Bibsdb\ProjectorScreenBundle\BibsdbProjectorScreenBundle::class => ['all' => true],
Load the Template Run the console command to load the slide template:
php artisan bibsdb:core:templates:load
Enable in Admin Activate the template in the administration panel (check the bundle’s docs for the exact UI steps).
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).
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 %}
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
}
}) }}
Integration with Slide Management Use the bundle’s template system to create slides in a CMS-like workflow:
slides table with video_id, title, order).projector_screen().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());
});
Ads/Controls Not Disabled
controls: false option (PLUS required).Template Not Loading
bibsdb:core:templates:load fails silently.-vvv:
php artisan bibsdb:core:templates:load -vvv
Resources/views/ directory.Asset Conflicts
php artisan vendor:publish --tag=projector-screen-assets
Then customize the published files in resources/public/bundles/bibsdbprojectorscreen/.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.
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
};
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);
}));
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),
]);
}
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
How can I help you explore Laravel packages today?