PHPackages                             hugomyb/filament-media-action - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. hugomyb/filament-media-action

ActiveLibrary[Image &amp; Media](/categories/media)

hugomyb/filament-media-action
=============================

Automatically display your media (video, audio, document, image, ...) with an action

v5.0.0.0(3mo ago)56122.2k↑25.4%156MITPHPPHP ^8.2CI failing

Since Jul 30Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/hugomyb/filament-media-action)[ Packagist](https://packagist.org/packages/hugomyb/filament-media-action)[ Docs](https://github.com/hugomyb/filament-media-action)[ GitHub Sponsors](https://github.com/hugomyb)[ RSS](/packages/hugomyb-filament-media-action/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (27)Used By (6)

▶️ Filament Media Action
========================

[](#️-filament-media-action)

[![Latest Version on Packagist](https://camo.githubusercontent.com/035e570f5ff5fec59b1552c33eb2374f9a8b3b0e722d4984471bf5c44d8eb3c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6875676f6d79622f66696c616d656e742d6d656469612d616374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hugomyb/filament-media-action)[![Total Downloads](https://camo.githubusercontent.com/8ff0d4d25f3ff0b0cf59fd944ae938b5e55d759a4638bc194e9f478569aebb91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6875676f6d79622f66696c616d656e742d6d656469612d616374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hugomyb/filament-media-action)

Automatically display your media (video, audio, pdf, image, ...) with an action in Filament. The package automatically detects the media extension to display the correct player.

Examples
--------

[](#examples)

[![example1](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example1.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example1.png)[![example2](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example2.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example2.png)[![example3](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example3.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example3.png)[![example4](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example4.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example4.png)[![example5](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example5.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example5.png)[![example6](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example6.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example6.png)[![example7](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example7.png)](https://raw.githubusercontent.com/hugomyb/filament-media-action/main/docs/example7.png)

Installation
------------

[](#installation)

> **Note for Filament v3 users:**
> If your project is running on **Filament v3**, please install the `3.x` version of this package:
>
> ```
> composer require hugomyb/filament-media-action:^3.0
> ```
>
>
>
> For **Filament v4**, simply install the latest version (default branch `main`).

You can install the package via composer:

```
composer require hugomyb/filament-media-action
```

Optionally, you can publish the view using

```
php artisan vendor:publish --tag="filament-media-action-views"
```

Optionally, you can publish the translations using

```
php artisan vendor:publish --tag="filament-media-action-translations"
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Like a classic Filament Action, you can use MediaAction anywhere (Forms, Tables, Infolists, Suffix and prefix, ...).

Simply provide the url of your media in the `->media()` method. The package will then automatically detect your media extension for display.

```
MediaAction::make('tutorial')
    ->iconButton()
    ->icon('heroicon-o-video-camera')
    ->media('https://www.youtube.com/watch?v=rN9XI9KCz0c&list=PL6tf8fRbavl3jfL67gVOE9rF0jG5bNTMi')
```

### Available options

[](#available-options)

#### Autoplay

[](#autoplay)

You can enable autoplay for video and audio by using the `->autoplay()` method.

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->autoplay()
```

You can also pass a closure in the method and access `$record` and `$mediaType` :

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->autoplay(fn($record, $mediaType) => $mediaType === 'video')
```

`$mediatype` can return "youtube", "audio", "video", "image" or "pdf".

#### Force Media Type

[](#force-media-type)

If the automatic media type detection fails (common with local development URLs or files without extensions), you can force the media type:

```
use Hugomyb\\FilamentMediaAction\\Actions\\MediaAction;

MediaAction::make('video')
    ->media('https://myapp.test/video.MOV')
    ->mediaType(MediaAction::TYPE_VIDEO) // Force video type (preferred)
```

Available media types (constants): `MediaAction::TYPE_VIDEO`, `MediaAction::TYPE_AUDIO`, `MediaAction::TYPE_IMAGE`, `MediaAction::TYPE_PDF`, `MediaAction::TYPE_YOUTUBE`. Strings remain supported for backward compatibility.

#### Preload

[](#preload)

To control the preload behavior, use the -&gt;preload() method. By default, it is set to true, which means the media will preload automatically. You can set it to false to disable preloading (this is helpful to avoid "Autoplay failed or was blocked" errors in some browsers).

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->autoplay()
    ->preload(false)
```

#### Control list

[](#control-list)

You can control the media player's interface by using the control list options. These options allow you to disable certain features of the HTML5 video and audio players.

> **Note:** Control list options only work in Chromium-based browsers (Chrome, Edge, etc.) and have no effect in Firefox, Safari, or other browsers.

You can use the following convenience methods:

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->disableDownload() // Prevents the user from downloading the media
    ->disableFullscreen() // Prevents the user from viewing the video in fullscreen
    ->disableRemotePlayback() // Prevents the user from using remote playback (e.g., Chromecast)
```

Each of these methods can accept a boolean or a closure:

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->disableDownload(fn($record) => $record->is_protected)
```

You can also set the control list directly using the `controlsList` method:

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->controlsList(['nodownload', 'nofullscreen', 'noremoteplayback'])
```

Or with a closure:

```
MediaAction::make('media-url')
    ->media(fn($record) => $record->url)
    ->controlsList(fn($record) => $record->is_protected ? ['nodownload'] : [])
```

#### Other options

[](#other-options)

You can customize the modal as you wish in the same way as a classic action (see ).

If there is an existing record, you can access it by passing a closure to `->media()` method.

Accessible parameters: `$livewire`, `$data`, `$model`, `$record`, `$arguments`.

Example :

```
MediaAction::make('media-url')
    ->modalHeading(fn($record) => $record->name)
    ->modalFooterActionsAlignment(Alignment::Center)
    ->media(fn($record) => $record->url)
    ->extraModalFooterActions([
        MediaAction::make('media-video2')
            ->media('https://www.youtube.com/watch?v=9GBXqWKzfIM&list=PL6tf8fRbavl3jfL67gVOE9rF0jG5bNTMi&index=3')
            ->extraModalFooterActions([
                MediaAction::make('media-video3')
                    ->media('https://www.youtube.com/watch?v=Bvb_vqzhRQs&list=PL6tf8fRbavl3jfL67gVOE9rF0jG5bNTMi&index=5')
            ]),

        Tables\Actions\Action::make('open-url')
            ->label('Open in browser')
            ->url(fn($record) => $record->url)
            ->openUrlInNewTab()
            ->icon('heroicon-o-globe-alt')
    ])
```

As shown in the example above, you can chain MediaActions together with `->extraModalFooterActions()` method.

Customizing the modal view
--------------------------

[](#customizing-the-modal-view)

You can customize the modal view by publishing the view using :

```
php artisan vendor:publish --tag="filament-media-action-views"
```

Then, in the view, you can access :

- `$mediaType`: To retrieve the type of your media, which can be “youtube”, “audio”, “video”, “image” or “pdf”.
- `$media` : To retrieve the url of your media

Supported media extensions
--------------------------

[](#supported-media-extensions)

TypeExtensionsVideomp4, avi, mov, webm, mkv, flv, wmv, 3gp, ogv, m4vAudiomp3, wav, ogg, aac, flac, m4a, wmaDocumentspdfImagejpg, jpeg, png, gif, bmp, svg, webp, tiff, icoChangelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mayonobe Hugo](https://github.com/hugomyb)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 72.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~41 days

Total

26

Last Release

112d ago

Major Versions

v3.1.1.9 → v4.0.0.02025-07-28

3.x-dev → v4.1.0.02025-11-04

v4.1.0.2 → v5.0.0.02026-01-26

PHP version history (2 changes)v3.1.0.0PHP ^8.1

v3.1.1.8PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/65a12f2e3c6b262cd42d0ebf14525f0c6066aa6563cd3ff06034e85f931c9c54?d=identicon)[hugomyb](/maintainers/hugomyb)

---

Top Contributors

[![hugomyb](https://avatars.githubusercontent.com/u/92823242?v=4)](https://github.com/hugomyb "hugomyb (67 commits)")[![clnt](https://avatars.githubusercontent.com/u/19330442?v=4)](https://github.com/clnt "clnt (8 commits)")[![masterix21](https://avatars.githubusercontent.com/u/6555012?v=4)](https://github.com/masterix21 "masterix21 (4 commits)")[![waggos-root](https://avatars.githubusercontent.com/u/74061899?v=4)](https://github.com/waggos-root "waggos-root (3 commits)")[![JibayMcs](https://avatars.githubusercontent.com/u/7621593?v=4)](https://github.com/JibayMcs "JibayMcs (3 commits)")[![luisprmat](https://avatars.githubusercontent.com/u/9275870?v=4)](https://github.com/luisprmat "luisprmat (3 commits)")[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (1 commits)")[![jimmystelzer](https://avatars.githubusercontent.com/u/67894?v=4)](https://github.com/jimmystelzer "jimmystelzer (1 commits)")[![mokhosh](https://avatars.githubusercontent.com/u/6499685?v=4)](https://github.com/mokhosh "mokhosh (1 commits)")[![claybitner](https://avatars.githubusercontent.com/u/868070?v=4)](https://github.com/claybitner "claybitner (1 commits)")

---

Tags

laravelhugomybfilament-media-action

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/hugomyb-filament-media-action/health.svg)

```
[![Health](https://phpackages.com/badges/hugomyb-filament-media-action/health.svg)](https://phpackages.com/packages/hugomyb-filament-media-action)
```

###  Alternatives

[awcodes/filament-curator

A media picker plugin for FilamentPHP.

434297.7k19](/packages/awcodes-filament-curator)[joaopaulolndev/filament-pdf-viewer

Filament package to show pdf document viewer

104147.2k3](/packages/joaopaulolndev-filament-pdf-viewer)[johncarter/filament-focal-point-picker

An image focal point picker for Filament Admin.

4326.5k1](/packages/johncarter-filament-focal-point-picker)[saasykit/laravel-open-graphy

An awesome open graph image (social cards) generator package for Laravel.

13057.0k](/packages/saasykit-laravel-open-graphy)[outerweb/filament-image-library

Filament integration for the outerweb/image-library package

2411.5k](/packages/outerweb-filament-image-library)[ace-of-aces/laravel-image-transform-url

Easy, URL-based image transformations inspired by Cloudflare Images.

1756.4k](/packages/ace-of-aces-laravel-image-transform-url)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
