Weave 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
Filament Media Action

Filament Media Action Laravel Package

hugomyb/filament-media-action

Filament Media Action lets you display video, audio, PDFs, images and more directly in Filament via an action. It auto-detects file extensions and selects the right player, works in forms, tables and infolists, and supports options like autoplay.

View on GitHub
Deep Wiki
Context7

Filament Media Action adds a ready-made Filament action that displays media — video, audio, PDF, or image — in a modal. It automatically detects the media extension and selects the correct player, so a YouTube URL opens a video player while a PDF opens a document viewer.

  • Automatic player detection for video, audio, PDF, and images
  • Works anywhere: tables, forms, infolists, suffix/prefix actions
  • Autoplay and YouTube support built in
  • Publishable views and translations
  • Filament v3 and v4 compatible
Frequently asked questions about Filament Media Action
How do I install hugomyb/filament-media-action in a Laravel Filament app?
Install it with a single Composer command: composer require hugomyb/filament-media-action. There are no migrations, no config file, and no manual service provider registration to worry about. Optionally publish the Blade view with php artisan vendor:publish --tag="filament-media-action-views" or the language files with the translations tag if you need to customize output.
Which Filament and PHP versions does filament-media-action support?
Package majors track Filament majors: use ^3.0 for Filament v3, ^4.x for Filament v4, and ^5.x for Filament v5 / PHP 8.5. Confirm your Filament version first, because installing the newest tag on an older panel will break. The package relies on Filament internals such as closure evaluation, so pin exact versions and treat every Filament upgrade as needing a quick media-action regression check.
How does MediaAction decide which player to render, and can I force a media type?
By default the package inspects the file extension in the URL and renders the matching player for video, audio, PDF, images, and YouTube links. For extensionless or ambiguous URLs it falls back to server-side HTTP header probing with a 5 second timeout. If you already know the type, chain ->mediaType() to skip detection entirely, which is faster and safer for external URLs.
Can I use MediaAction in table actions, forms, and infolists?
Yes. MediaAction extends Filament's native Action class, so it works anywhere a Filament action works: table row and bulk contexts, form components, infolists, page or header actions, and suffix/prefix slots. You configure it with the same fluent API you already use, so existing action knowledge transfers directly without learning a new rendering system.
How do I enable autoplay for video and audio previews?
The package exposes an autoplay option you chain onto the MediaAction, and the Blade player receives it as the native autoplay attribute. Be aware that browsers block autoplay with sound until the user interacts with the page or the media is muted, so test in Chrome, Firefox, and Safari before shipping. If autoplay matters for a specific panel, verify behavior on the exact media formats your records store.
Can I prevent users from downloading or fullscreening protected media?
The disableDownload(), disableFullscreen(), and disableRemotePlayback() options map to the controlsList attribute, which only Chromium-based browsers respect, so they are not a security or compliance control. Users on Firefox or Safari, or anyone with dev tools, can still retrieve the underlying URL. Real protection requires short-lived signed URLs or server-side authorization before the file is served.
How do I customize the modal heading, controls, and footer actions?
Everything is configured through closures in the Filament style: ->media(), ->modalHeading(), ->controlsList(), and chained ->extraModalFooterActions(). For deeper changes, publish the Blade view and edit the markup, or subclass MediaAction and register your own action to enforce house conventions like icons, modal width, and default control lists.
Is it safe to pass user-controlled or internal URLs to ->media()?
No, not without guardrails. For extensionless URLs the package makes outbound HTTP requests with a 5 second timeout during admin rendering, which is both an SSRF vector and a latency risk if the host is internal or attacker-supplied. Always force ->mediaType() on untrusted or internal-network URLs, allowlist permitted hosts, and avoid letting tenants point the action at arbitrary endpoints.
Do presigned S3 or CDN URLs and embedded PDFs and YouTube links work in the modal?
They work as long as the URL is still valid when the browser loads it, but modal dwell time plus preloading can outlive short-lived signatures, so refresh tokens server-side or use longer TTLs. Embedded PDFs and YouTube iframes depend on your Content-Security-Policy allowing the relevant frame-src origins. Also keep in mind that extension-based typing means a mislabeled file can render in the wrong player or fail silently.
Is filament-media-action actively maintained, and what if it gets abandoned?
It is a single-maintainer package with modest adoption, though recent release activity is a positive signal and the v5.0.0.1 patch shows the author responding to Filament breakage. The bus factor is one and there is no commercial support tier, so pin versions and plan a regression pass on each Filament bump. If maintenance stops, the surface is small enough to fork and vendor: one action class, one Blade view, and a few translation files.
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator