Embed: save stream state, and if the stream is playing, don't show annoying 'Stream is waiting for data' messages.

This commit is contained in:
Cat 2020-01-09 14:46:05 +01:00 committed by Thulinma
parent ead434b730
commit 9b92496f4e
3 changed files with 12 additions and 1 deletions

View file

@ -931,6 +931,7 @@ function MistVideo(streamName,options) {
MistVideo.log(e);
e = data.on_error;
}
MistVideo.state = data.error;
var buttons;
switch (data.error) {
case "Stream is offline":
@ -939,16 +940,23 @@ function MistVideo(streamName,options) {
case "Stream is booting":
case "Stream is waiting for data":
case "Stream is shutting down":
if ((MistVideo.player) && (MistVideo.player.api) && (!MistVideo.player.api.paused)) {
//something is (still) playing
return;
}
buttons = {polling:true};
break;
default:
buttons = {reload:true};
}
MistVideo.showError(e,buttons);
}
else {
//new metadata object!
//console.log("stream status stream said",data);
MistVideo.state = "Stream is online";
MistVideo.clearError();
if (!MistVideo.info) {
onStreamInfo(data);