Rails ActiveStorage audio Content range

1k Views Asked by At

It started as a simple use for ActiveStorage, just store some audio files in mp3 format (done easily) and display it on the site:

<%= audio_tag url_for(recording.audio_file), controls: true, preload: "none" %>

I tested on Chrome and Firefox and it works, I can play the audio no problem as many times as I want, but when I tested it on Safari I came across the problem that Safari assumes that the server supports Content-Range so Safari thinks it is a Live Stream and the html5 element can only play once.

So I've been searching the Internet for how to fix this and I've seen answers that point to:

Anyone has any pointers on how to use ActiveStorage to store and provide audio that can be presented using the html5 audio tag that works for Chrome, FireFox, and Safari.

Thanks for your help.

0

There are 0 best solutions below