St.audio() stopped working on iOS Safari (again?)

Hi!

It seems that st.audio() stopped working on iOS Safari. Similar issue was already resolved in 2020 so…potential regression? Before posting an issue to github I would be gratefull if someone could check if you are encountering the same behavior :slight_smile:

https://adventure.streamlit.app/

Hey @TomJohn,

It works on my computer! Is it just not playing the audio on yours?

Actually I take that back, it’s only working on Chrome (not Safari)

1 Like

Posted a response on the GitHub Issue, but I think you need to set format="audio/mpeg" for mp3s, and it should work. :slight_smile: Let me know if you hit any more issues.

2 Likes

Hi @kmcgrady, thank you, it works! Awsome! I guess that we could edit the documentation to include this little but quite important fact :wink:

I’d hesitate to say it’s a docs issue. The default mime type for st.audio is audio/wav. Depending on the file you want to play, it can be audio/aac, audio/midi, audio/ogg, audio/webm, and so on:

The RFC-defined mime type for .mp3 files is audio/mpeg, not audio/mp3 as was in the app. Seems like programming user-error to me.

1 Like

Hi @snehankekre! True. It’s not a matter of insufficient documentation, however as an end-user, it would be helpful to have an MP3 example included in the documentation for better usability :slight_smile:

Fair point! If it’s a fairly common use-case, it definitely warrants an example :+1: I’ll add one this week :smile:

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.

:eyes:

@TomJohn

1 Like

Nice :slight_smile:! I love the example mp3 purrrr :smile_cat: