hugomyb / filament-media-action

Automatically display your media (video, audio, pdf, image, ...) with an action in Filament
https://filamentphp.com/plugins/hugomyb-media-action
MIT License
33 stars 5 forks source link

[Bug]: Audio files do not load on mobile #10

Closed andykeeling closed 3 weeks ago

andykeeling commented 3 weeks ago

What happened?

I can't get audio files to load when deployed to production on mobile (iPhone 16 Pro - tried Chrome and Safari). I get an infinite spinner with the 'Loading...' text.

Video files load fine. Images not tested.

How to reproduce the bug

Load an audio file from MediaAction.

Package Version

3.1.0.9

PHP Version

8.3.0

Laravel Version

11.22.0

Which operating systems does with happen with?

No response

Notes

No response

hugomyb commented 3 weeks ago

Hi there ! Can you try publishing the modal view and replace the existing audio tag with this one :

<audio x-ref="mediaFrame" class="rounded-lg w-full" controls @canplay="loading = false" @loadeddata="loading = false" @play="loading = false">
    <source src="{{ $media }}" type="{{ $mime }}">
    Your browser does not support the audio element.
</audio>

What type of audio file are you using? mp3 ? ogg ? wav ?

Is the audio resource you're trying to load in https and not http ?

andykeeling commented 3 weeks ago

Hi Hugo - thanks a lot for your help - that got it working now!

FYI it is mp3 and https.

hugomyb commented 3 weeks ago

Great!

I'll update my code and publish a new version with the updated code.

Fixed in latest release : v3.1.1.0