goldfire / howler.js

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

Player stops media playing randomly #1472

Open anderaguina opened 3 years ago

anderaguina commented 3 years ago

We've been using your howlerJS library for a couple of years now and we've had several issues that we've been able to resolve.

But there is this one problem we haven't been able to sort:

We are playing medias in a playlist that runs all day long and once or twice a day a media will finish and it won't start playing the next, here are some details of how our process works:

There is a process that checks if the media is about to finish (1,7 seconds + seek)>=duration. If that's the case we will start playing the next media in the playlist(Howl.play) and start loading the 2 next medias (Howl.load).

3 seconds after this we will call Howl.unload() on the media that just finished to free memory.

This process works fine most of the time but there is once or twice every 15 hours where this process doesn't work and the new media stays stuck without playing.

The reason we don't use the onEnd event is because when using it we get a gap between the media.

Would you have any pointers on where the problem is or where we should look at this? We've been trying to sort this problem for months. We haven't been able to find a pattern on when it happens, everything seems to be the same but the next media won't start and the player will stay stuck until the page is reloaded.

We also have the following questions:

  1. How long does a media need to be loaded so we can start playing it?
  2. Do we need to call Howl.load? or can we just call Howl.play and let that load the media file? Wont this create a gap between 2 medias?
  3. Should the onEnd event allow to play the next media without gap? Medias are usually between 3 and 5 minute long.
kwaziphi commented 3 years ago

would you tell, what device do you use? i've implemented crossfading (is what you use if im right) through 2 instances changing each other. anyway it didnt help to go through background IOS working and music just stops on someway.

i know that web audio API plays music only after full file dowloading and html5 plays almost immediatly because it plays from downloaded buffer part by part. time for downloading depends on technique (web audio or html5), internet speed.

(im just user of howler js)

anderaguina commented 3 years ago

would you tell, what device do you use? i've implemented crossfading (is what you use if im right) through 2 instances changing each other. anyway it didnt help to go through background IOS working and music just stops on someway.

i know that web audio API plays music only after full file dowloading and html5 plays almost immediatly because it plays from downloaded buffer part by part. time for downloading depends on technique (web audio or html5), internet speed.

(im just user of howler js)

I'm using Laptops and Desktop computers running both linux and windows and trying different web browsers (Chrome, Firefox, Opera...)