hugomyb/filament-media-action
Filament action to preview media (video, audio, PDF, images, etc.) anywhere in your app (forms, tables, infolists, prefix/suffix). Just pass a media URL and it auto-detects the extension to render the right player/viewer.
composer require hugomyb/filament-media-action). Supports Filament v3–v5 and PHP 8.1–8.5, ensuring broad compatibility.$get, $set).storage:link for Laravel) to avoid CORS/loading issues.youtube.com/watch?v=...). Malformed URLs may break playback.controlsList options.preload(false)).->preload(false).storage:link)..MOV vs .mov, case sensitivity).controlsList) critical? If Firefox/Safari support is needed, consider fallback UIs.muted attribute or user interaction).php artisan vendor:publish.storage or public paths if URLs are correctly routed.<video controls> in Blade).Post model with video/audio fields).MediaAction in Tables and Forms.use Hugomyb\FilamentMediaAction\Actions\MediaAction;
MediaAction::make('Preview')
->icon('heroicon-o-play')
->media(fn($record) => $record->video_url)
->autoplay(fn($record) => $record->is_premium)
->disableDownload();
storage:link and various extensions (e.g., .MOV, .mp4).youtube.com/watch?v=...).| Component | Compatibility | Mitigation |
|---|---|---|
| Filament v3/v4/v5 | ✅ Supported (version-specific Composer tags). | Use correct tag (e.g., :^3.0 for v3). |
| PHP 8.1–8.5 | ✅ Supported. | Ensure project PHP version matches. |
| Local Files | ⚠️ Requires proper URL routing (e.g., storage:link). |
Test with php artisan storage:link. |
| YouTube | ✅ Supported (embed URLs). | Validate URL format (e.g., youtube.com/watch). |
| Chromium Controls | ⚠️ controlsList ignored in Firefox/Safari. |
Provide fallback UI or document limitations. |
| Autoplay | ⚠️ Browser policies may block autoplay. | Use preload(false) or muted attribute. |
php artisan storage:link.composer require hugomyb/filament-media-action
(Use :^3.0 for Filament v3, omit for v4/v5.)php artisan vendor:publish --tag="filament-media-action-views"
php artisan vendor:publish --tag="filament-media-action-translations"
MediaAction in Filament schemas.vendor:publish.LogAction or custom middleware.dd() in closures (e.g., ->media(fn($record) => dd($record->url))) for troubleshooting.How can I help you explore Laravel packages today?