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

File diff suppressed because one or more lines are too long

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);

View file

@ -1728,6 +1728,9 @@ MistSkins["default"] = {
else if ("decodingIssues" in MistVideo.skin.blueprints) { //dev mode
if (("player" in MistVideo) && ("api" in MistVideo.player) && (MistVideo.video)) {
details = [];
if (typeof MistVideo.state != "undefined") {
details.push(["Stream state:",MistVideo.state]);
}
if (typeof MistVideo.player.api.currentTime != "undefined") {
details.push(["Current video time:",MistUtil.format.time(MistVideo.player.api.currentTime)]);
}