Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FireFox stream stoped #883

Closed
amirping opened this issue Dec 20, 2017 · 12 comments
Closed

FireFox stream stoped #883

amirping opened this issue Dec 20, 2017 · 12 comments

Comments

@amirping
Copy link

i use howler to play stream from URL . it work correctly on chrome , but with Firefox the stream auto stop after few seconds ( about 20s ) .

  this.sound = new Howl({
      src: [streamUrl],
      html5: true,
      autoplay : true, // try to fix 
      format: ['mp3'] // try to fix 
});

on chrome it work even without the autoplay and the format option .
Firefox Quantom 57.0.2

@asaivan
Copy link

asaivan commented Dec 20, 2017

I have had the same issue. Trying to get it working on FF 57. Stops after 1 second with no errors.

@roks0n
Copy link

roks0n commented Dec 22, 2017

Having the same issue, these are my settings:

radio = new Howl({
    src: stations[currentStation].stream,
    html5: true,
    format: ['mp3'],
    volume: volume,
});
radio.play();

It stops streaming the file after a few seconds. I'm currently using howler v2.0.4 in FF 57.0.1. Will update it and see if it works on the latest one. I'm not seeing any errors/warnings in the console.

Update 1: Also broken on howler v2.0.7.
Update 2: I did some digging and noticed that when the sound stops playing the onend function is called. I wasn't able (yet) to figure out what exactly causes this.

@trvbr
Copy link

trvbr commented Dec 22, 2017

This is happening for us as well.

Test it here: https://jsfiddle.net/trvbr/guw1uu1L

SoundManager2 works in the same Firefox environment. Check out his (Scott Schiller's) code for pointers? Maybe there is a hack in there that fixes it.

@amirping
Copy link
Author

@roks0n yes i noticed that , i think it's problem with buffer or some think like that since the onend function is called when the media end .

@goldfire
Copy link
Owner

goldfire commented Dec 29, 2017

Interesting, I wonder when this change was made in Firefox. Unless I'm missing something, it looks like the only way to fix this is to listen to the durationchange event and re-create the ended timer with the difference in duration added on. This feels really hacky though. Has anyone found any other way to detect if a stream is being played in Firefox (the duration of Infinity was being relied upon previously)?

@AlteranAncient
Copy link

I've just been bitten by this as well. I made the leap from Chrome to Quantum a few weeks ago, and I've noticed some odd behaviour specific to the current version of Firefox:

  • (On latest Howler), Firefox will stop playing any stream after a short amount of time. SM2 behaves for MP3s, but randomly cuts-off when playing OGG streams.
  • (In SoundManager2), Firefox will randomly decide to stop playing Vorbis or Opus streams in .ogg wrappers.

I realise you're probably not that interested in SM2 itself, but I think that it is probably helpful to know that Firefox may not be handling streams with OGG extensions correctly - and that it might not be specific to Howler.

@ntavelis
Copy link

I have the same issue, using the version 2.0.5 solves this problem. So a change must have been made after this version.

@kenger
Copy link

kenger commented Jan 30, 2018

Yeah, I can confirm that works. Versions 2.0.7 and 2.0.8 have the problem, i dont know for version 2.0.6 but version 2.0.5 is working.

@ntavelis
Copy link

2.0.6 has the same issue.

@mmavko
Copy link

mmavko commented Jan 30, 2018

same issue here. jsfiddle: https://jsfiddle.net/guw1uu1L/3/

playback stops after some 5 seconds (Chrome 64, Mac OS, Ubuntu).

update: Chrome itself can't play this file either. navigate directly to https://storage.googleapis.com/aloud-145812.appspot.com/344669%2Fmp3%2Farticle-344669.mp3 and playback will similarly stop. Firefox is OK. Looks like it's Chrome 64 problem.

@goldfire
Copy link
Owner

goldfire commented Feb 2, 2018

The reason it "works" in 2.0.5 is because it is broken. The ended event is still getting fired, but since the sound is still playing, howler goes into an infinite timeout loop checking for it to be over. The addition of a time check relative to the reported duration causes it to end at the correct time (ee3d0ae). Since it is a stream, the duration should be reported as Infinity, but for some reason, Firefox is reporting an incorrect duration value.

@kenger
Copy link

kenger commented Feb 5, 2018

Usage of an html5 audio element show the strange behavior of Firefox. An audio element with my live stream source has an increasing duration instead of a positive Infinite as specified by the html5 spec.

I dont know if this is a problem with my server (ICEcast) metadata or Firefox. I dont understand how firefox should know if an mp3 is a live or not.

ringcrl pushed a commit to ringcrl/howler.js that referenced this issue Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants