goldfire / howler.js

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

HowlerJS and html5 video on iOS #1223

Open heand opened 4 years ago

heand commented 4 years ago

Hi, I have trouble playing sounds via HowlerJS together with html5 video. If I play a video from the html5 video tag, and then start an audiofile (howlerJS), the audio gets destorted on ipad (not desktop PC). I can set html5:true, but then i cannot control the file volume etc on the audio. Audio and Video are supposed to play together in this case, working on a tool for listening training.. Any ideas?

Joshfindit commented 4 years ago

Have you tried the same test with 2 HMTL5 videos?

heand commented 4 years ago

Yes, two HTML5 videos is no problem.

copypasteho commented 4 years ago

Re iOS: Have you had any sucess/failure getting background mode to work when the app is in the background with either one or both media objects playing?

heand commented 4 years ago

I still have issues with this. Sometimes when app is in the background, audio is lost. When I bring the app back up, no audio is playing. I have to clear it from memory and restart.

copypasteho commented 4 years ago

TLDR: iOS13 doesn't play well with Javascript -- especially in the background.

I've been spending the last two weeks trying to figure out wtf is going on (in general - regarding iOS and background audio/video). The bottom line seems to be that iOS is agressively killing/breaking various apps' functionalities which utilize background modes.

more info: https://twitter.com/marcoarment/status/1189899504562122752

Seriously, just search for iOS 13 breaking apps and you'll find a host of idiotic failures present in both ios13, as a whole, and the latest iOS 13.2 update.

Considering the amount of time I lost debugging problems which are a result of sloppy management at a firm which positions itself as top-tier; Android has never looked so appealing to me as both an end-user and developer.

Save your sanity and play around with some of the streaming radio/video demos on Github. iOS kills Javascript execution for backgrounded apps, which pretty much invalidates some of the key benefit of Howler.

I think React Native/NativeScript is another avenue worth exploring if you want a timely fix.

Have you tried examining breakpoints in XCode to dig deeper at the cause of the problem? I'm convinced it's a JS running in the background problem; don't waste your time trying to debug this if you value your sanity.