teltek/pumukit-paella-player-bundle
Symfony bundle for PuMuKIT WebTV that replaces the default Pumukit Player Bundle with the Paella Player. Install via Composer, unregister the base player bundle/routes/config, enable PaellaPlayer bundle and routing, then clear cache and install assets.
Prerequisites Check:
bundles.php, routing.yaml, and pumukit_player.yaml configurations.Installation:
composer require teltek/pumukit-paella-player-bundle
Configuration:
config/bundles.php:
// Remove this line:
Pumukit\PlayerBundle\PumukitPlayerBundle::class => ['all' => true],
Pumukit\PaellaPlayerBundle\PumukitPaellaPlayerBundle::class => ['all' => true],
config/routes/annotations.yaml to point to the new bundle:
pumukit_player:
resource: "@PumukitPaellaPlayerBundle/Resources/config/routing.yml"
prefix: /
config/packages/pumukit_player.yaml.Clear Caches and Reinstall Assets:
php bin/console cache:clear
php bin/console cache:clear --env=prod
php bin/console assets:install
First Test:
Basic Integration:
Customizing Paella Player:
# config/packages/paella_player.yaml
paella_player:
theme:
path: '%kernel.project_dir%/public/paella-themes/custom-theme'
name: 'custom-theme'
// In your custom JS file (e.g., app.js)
PaellaPlayer.prototype.initPlugins = function() {
this.plugins = ['subtitles', 'analytics', 'ads'];
// Custom plugin logic
};
Hybrid Approach (Advanced):
// src/Controller/CustomPlayerController.php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CustomPlayerController extends AbstractController {
#[Route('/custom-player/{id}', name: 'custom_player')]
public function show($id) {
return $this->render('@PumukitPaellaPlayer/player.html.twig', [
'videoId' => $id,
]);
}
}
Asset Management:
assets:install to symlink Paella Player assets to your public/ directory.asset() function in Twig templates to reference Paella Player JS/CSS:
{{ asset('bundles/pumukitpaellaplayer/js/paella-player.js') }}
Debugging Workflow:
// Add to your custom JS
PaellaPlayer.prototype.debug = true;
Bundle Conflict:
PumukitPlayerBundle or its routing/configuration can cause conflicts, leading to broken player functionality or duplicate routes.config/bundles.php, routing.yaml, and pumukit_player.yaml for leftover traces of the default player.Asset Loading Failures:
php bin/console assets:install after installation.public/bundles/pumukitpaellaplayer/.JavaScript Conflicts:
data-paella-player attributes to scope its initialization to specific elements.$(document).ready() or DOMContentLoaded event.Caching Issues:
cache:clear --env=prod and cache:pool:clear).Ctrl + F5).Paella Player Version Mismatch:
composer.json.Missing Configuration:
PumukitPaellaPlayerBundle’s Resources/config/ for default configurations you may need to override.DRM or Advanced Features:
Enable Symfony Debug Mode:
APP_DEBUG=1 in .env to enable the profiler and detailed error logs./_profiler/ to inspect routes, templates, and asset loading.Check Paella Player Console Logs:
F12) and navigate to the Console tab to catch JS errors (e.g., PaellaPlayer is not defined).Validate Twig Templates:
@PumukitPaellaPlayer/player.html.twig) is being rendered correctly. Override it if needed:
mkdir -p templates/PumukitPaellaPlayer
cp vendor/pumukit/paella-player-bundle/Resources/views/player.html.twig templates/PumukitPaellaPlayer/
Test with Minimal Configuration:
Network Tab Inspection:
// app.js
PaellaPlayer.prototype.customInit = function() {
this.options
How can I help you explore Laravel packages today?