Orange-OpenSource / hasplayer.js

Http Adaptive Streaming javascript player based on HTML5 premium extensions (MSE/EME)
Other
197 stars 67 forks source link

Does HasPlayer support Failover? #161

Closed ghost closed 7 years ago

ghost commented 7 years ago

I have several streams. I load the player with one stream and my expectation is player to ask for next active stream if current stream is interrupted or at least I expect player to throw an exception when stream is interrupted. Does HasPlayer support FailOver?

nicosang commented 7 years ago

could you tell me which streaming protocol you use?

ghost commented 7 years ago

Hi Nicolas, Smooth Stream. My expectation is to see an error or timeout event when stream is interrupted and there is no endOfStream flag after certain time. My player version is 1.10.

bbert commented 7 years ago

What do you mean "when the stream is interrupted"? If the download of segments fails you should get an error (DOWNLOAD_ERR_CONTENT).

ghost commented 7 years ago

During live broadcast I plug out the data cable from the encoder (Camera). In this case what I see is a continues buffering player. In this case I am expecting to get an error as (DOWNLOAD_ERR_CONTENT) but I don't get any error. I am getting error messages as "MEDIA_ERR_CODEC_UNSUPPORTED" , but not any error when I plug out the data cable from the encoder (Camera). Player just continues to buffer. Maybe I need to set some buffer timeout value to force player to trigger an error. How can I do that?

bbert commented 7 years ago

Maybe the player still receives data segments, but with "empty" data since you plugged out input data stream before encoder? In that case, there is no way for the player to detect any error.

ghost commented 7 years ago

I found the reason: in v10 in line 3060 where loadNextFragment failed if (isDynamic){ // If live HLS, then check buffer since playlist should be updated if (manifest.name === "M3U") { //Check for player timeout updateCheckBufferTimeout.call(this); } } else { // For VOD streams when stream is interrupted, signal end of stream signalStreamComplete.call(this); }

There is no check for Live Smooth Stream. For Smooth Live 'isDynamic' is true, but this condition doesn't look for Smooth Stream. This condition is valid only for HLS. That is why player with Live Smooth Stream will just stay on buffering state.

bbert commented 7 years ago

Because in live there is no notion of end of stream. So if I understand correctly, the last smooth segment the player received and processed does not contain the timestamps of the subsequents segments (in tfrf box). That is why the live segment timeline is interrupted. Do you confirm? In that case, maybe we can imagine raising an error if tfrf is missing or empty.

ghost commented 7 years ago

Yes, it is exactly what I am looking for.

bbert commented 7 years ago

Addressed in PR #174