Weave Code
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 Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v5.0.0.1

What's Changed

Bug Fixes

  • Fixed Call to a member function makeGetUtility() on null error when using $get (or $set) as a parameter in the ->media() closure when the action is not attached to a schema component (e.g. header actions, table row actions, page actions).

Behavior

  • Inside a schema context (form, infolist, suffix/prefix action on a field): $get and $set work as expected.
  • Outside a schema context: $get and $set are now safely null instead of throwing — your closure can guard against it (e.g. if ($get) { ... }).

Example

MediaAction::make('media-url')
    ->media(fn ($get, $record) => $get
        ? $get('media_url')
        : $record->url
    )

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v5.0.0.0...v5.0.0.1

v4.1.0.2

Fixes

  • Stop media playback when closing the modal — audio/video are paused and reset
  • YouTube embeds are paused via enablejsapi=1

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v4.1.0.1...v4.1.0.2

v4.1.0.0

Release notes — Media type constants + mediaType() fix

Highlights

  • New public constants for media types
  • Fix for infinite “loading” when forcing media type via mediaType()
  • More robust MIME handling in views
  • No breaking changes

Added

  • Media type constants on MediaAction:
    • TYPE_YOUTUBE, TYPE_AUDIO, TYPE_VIDEO, TYPE_IMAGE, TYPE_PDF, TYPE_UNKNOWN
  • Recommended to use constants with mediaType() for clarity and safety
  • Strings remain supported for backward compatibility

Fixed

  • Forcing the media type (e.g., ->mediaType('audio')) could leave the player stuck on “loading”:
    • MIME is now determined when possible even if the type is forced
    • The type attribute is omitted when MIME is unknown to avoid browser blocking
  • Avoids evaluating closures that require Livewire context when a type is already forced

Changed

  • Blade view comparisons now use constants (internal change, no user-facing impact)
  • README updated to recommend constant usage

Compatibility / Migration

  • No breaking changes
  • Optional (recommended): replace string literals with constants
    • Example: ->mediaType('audio')->mediaType(MediaAction::TYPE_AUDIO)

Example

use Hugomyb\FilamentMediaAction\Actions\MediaAction;

MediaAction::make('video')
    ->media('https://myapp.test/video.MOV')
    ->mediaType(MediaAction::TYPE_VIDEO);

Internal

  • Added a lightweight HasMedia marker trait and applied it on MediaAction
  • Added unit tests for constants and adjusted existing tests accordingly

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v4.0.0.0...v4.1.0.0

v3.1.1.9

Enhanced Video Support & Local Development Fixes

🚀 New Features

Force Media Type Detection

  • New mediaType() method to override automatic media type detection
  • Perfect for local development URLs and edge cases where automatic detection fails
MediaAction::make('video')
    ->media('https://myapp.test/video.MOV')
    ->mediaType('video') // Force video type

🐛 Bug Fixes

Fixed Local Video Loading Issues

  • Resolved: Videos from local storage URLs showing "Loading..." indefinitely
  • Fixed: Case-sensitive file extension detection (.MOV vs .mov)
  • Improved: Network timeout handling for local development domains

Enhanced Media Type Detection

  • Added timeout protection (5 seconds) for HTTP header requests
  • Better error handling for inaccessible URLs
  • Graceful fallback when header detection fails

📈 Improvements

Expanded Format Support

  • Video formats: Added support for mkv, flv, wmv, 3gp, ogv, m4v
  • Audio formats: Added support for flac, m4a, wma
  • Image formats: Added support for tiff, ico
v3.1.1.7

🚀 Release v3.1.1.7 – Dynamic Closure Dependency Resolution

✨ What's New?

Automatic resolution of dependencies for evaluate()

  • No more manual listing of dependencies (record, model, arguments, data, livewire).
  • All closures evaluated with evaluate() now automatically receive all available dependencies.
  • Improved flexibility and maintainability of the package.

🐛 Fixes & Improvements

  • Optimized code to eliminate redundant calls to resolveDefaultClosureDependencyForEvaluationByName().
  • Reduced errors caused by missing dependencies in evaluate().
v3.1.1.4

Release: Improved Media Loading Experience

Features

  • Added consistent loading indicator display for all media types, including YouTube videos, images, and PDFs.
  • Introduced a delay mechanism (200ms) to ensure the loading indicator is visible for fast-loading media.

Fixes

  • Resolved an issue where the loading indicator would not appear for images and iframes.
  • Improved initialization logic to handle unsupported or missing media elements without errors.
  • Enhanced media handling to better support <video>, <audio>, <img>, and <iframe> elements.

Notes

This release enhances the user experience by providing a reliable loading indicator for all supported media formats in the Filament Media Viewer package.

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.1.3...v3.1.1.4

v3.1.1.3

Release: Media Viewer Fixes and Improvements

Features

  • Enhanced media type support: Improved handling for YouTube videos, images, PDFs, and other media types in the viewer.
  • Added dynamic checks for <video> and <audio> elements to prevent errors when unsupported methods like .load() are called.

Fixes

  • Resolved Alpine Expression Error: "mediaElement.load is not a function" by ensuring .load() is only invoked on compatible media elements.
  • Improved stability and loading logic for all media types, including fallback handling for <img> and iframes.

Notes

This release ensures a smoother user experience and greater compatibility for diverse media formats in the Filament Media Action package.

v3.1.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.1.0...v3.1.1.1

v3.1.1.0

What's Changed

  • Fix audio loading on iOS devices: Resolved an issue where audio files were not loading properly on iPhones, resulting in an infinite spinner. Added additional event listeners (canplay, loadeddata, and play) to improve the loading state handling of audio elements.

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.0.8...v3.1.1.0

v3.1.0.9

What's Changed

New Contributors

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.0.8...v3.1.0.9

v3.1.0.8

Feature: Media Autoplay in Modal

Description:

Implemented a media autoplay feature that automatically plays embedded audio, video, and YouTube media when the modal is opened. This feature adds the ->autoplay() method.

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.0.7...v3.1.0.8

v3.1.0.7

Fix

Add default value to $mime to prevent "MediaAction::$mime must not be accessed before initialization"

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.0.6...main

v3.1.0.6

Fix

Enhanced the mime type detection of complex media url

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.0.5...main

v3.1.0.5

Fixed "Unsupported media type" if the media url has no extension, checking the Content-Type header

Full Changelog: https://github.com/hugomyb/filament-media-action/compare/v3.1.0.4...main

v3.1.0.4

Fixed error message "Unsupported media", if the media url contains query parameters

v3.1.0.3

Fix :

  • Remove google viewer for PDFs
v3.1.0.2

Fixes :

  • Use google viewer for PDFs
  • Add min-height and fix style for PDFs viewer
v3.1.0.1

Fixes :

  • Better use of loading state, to check that the media is not already loaded
  • Using an embed tag instead of an iframe to display pdf files
v3.1.0.0

Release v3.1.0.0

What's New

  • First stable version of the plugin for FilamentPHP.
  • Add MediaAction to display images, videos, audio, pdf, ... quickly and easily

Features

  • Add MediaAction for Tables, Forms, Infolists, ...
  • Supports Laravel 11 and FilamentPHP V3.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky