goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.29k stars 2.21k forks source link

Audio doesnt play if i set html5 to true and audio doesnt play on background if i set html5 to false, Iphone latest ios version #1721

Closed AashirBhusal closed 1 month ago

AashirBhusal commented 2 months ago

The Problem

Audio doesnt play if i set html5 to true and audio doesnt play on background and only plays on safari if i set html5 to false. it was working fine before by setting html 5 to true but suddenly updated to new ios version and now the audio doesnt play at all. how do i fix this and make it so like before it plays and also plays background its huge headache.

Reproducible Example

No response

Reproduction Steps

set html 5 to true and play audio on safari with 17.4.1 ios version.

Possible Solution

dont know

Context

No response

Howler.js Version

latest

Affected Browser(s)/Versiuon(s)

No response

Supplementing commented 2 months ago

Im also having the same issue. Audio has worked fine for years with my app but as of a recent iOS update, it is no longer playing as intended. FWIW, im using Ionic & capacitor which renders a webview that the audio is being played inside of.

mischa78 commented 2 months ago

I have the same issue. For now I am using html5: false on iOS 17.4, but I hope this can get fixed properly in Howler.

Timtam commented 2 months ago

Having the same issue here. For some weird reason I can't get html5: false to work under Chrome on desktop nor iOS, so I guess i'm doing something wrong here. Basically creating the Howl with src and format the same way it works with html5: true, then set volume and hit play(), but that doesn't play. How do you make it work under Desktop + iOS?

mischa78 commented 2 months ago

@Timtam I did this to only use html5: false on iPhone with iOS 17.4:

html5: /iPhone OS 17_4/.test(window.navigator.userAgent) ? false : true,
Timtam commented 2 months ago

Interesting, I'll have to try if that works on iOS but it certainly doesn't work on other browsers if html5 is false. As a side note, for some weird reason, the old playback behaviour on iOS 17.4.1 still works for me with really short files (about 200 kb each and just 3 seconds long). A huge file (at least 2 minutes long and more) doesn't work though, and as far as I can see the state remains at "unloaded" all the time, or something like that (don't know about the Howler internals yet).

AashirBhusal commented 2 months ago

the issue is similar to #1711 but the fix doesn't apply to me, waiting for official fix

Timtam commented 2 months ago

You are right, I found it just an hour before your message came in. I successfully switched to the @catalogworks/howler.js branch with html5: true and it fixed it in my use-case. It'd be great to have an official release which addresses this issue at some point, but its better than nothing for sure.

jamesharding commented 1 month ago

Seems to be fixed in iOS 17.5 for me!

AashirBhusal commented 1 month ago

yup its fixed its working correctly for me now.