Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2018-07-23 12:53:28 +02:00
commit 0f0615236f
9 changed files with 41 additions and 16 deletions

View file

@ -81,7 +81,6 @@ MistPlayer.prototype.getElement = function(tag){
this.element = ele; this.element = ele;
return ele; return ele;
}; };
MistPlayer.prototype.onreadylist = [];
MistPlayer.prototype.onready = function(dothis){ MistPlayer.prototype.onready = function(dothis){
this.onreadylist.push(dothis); this.onreadylist.push(dothis);
}; };
@ -930,8 +929,25 @@ function mistPlay(streamName,options) {
if (!('type' in info) || (info.type != 'vod')) { //always show the button timer, unless its a vod if (!('type' in info) || (info.type != 'vod')) { //always show the button timer, unless its a vod
//reload timeout //reload timeout
var delay = ('type' in info ? 20 : 60); var delay = 20;
i.className = 'countdown'+delay; if (!("type" in info)) {
if ("reloadDelay" in options) {
delay = options.reloadDelay;
try {
var css = document.createElement("style");
i.appendChild(css);
css.sheet.insertRule(".countdown[data-delay=\""+delay+"\"] { animation-duration: "+delay+"s; }");
css.sheet.insertRule(".countdown[data-delay=\""+delay+"\"]:before { animation-duration: "+delay/2+"s,"+delay+"s; }");
}
catch (e) {}
}
else {
delay = 60;
}
}
i.className = 'countdown';
i.setAttribute("data-delay",delay);
err.timeOut = protoplay.timer.add(function(){ err.timeOut = protoplay.timer.add(function(){
protoplay.report({ protoplay.report({
type: 'playback', type: 'playback',

View file

@ -360,19 +360,18 @@
} }
} }
.countdown, .countdown20, .countdown60 { .countdown {
height: 1em; height: 1em;
width: 1em; width: 1em;
display: inline-block; display: inline-block;
vertical-align: bottom; vertical-align: bottom;
border-radius: 50%; border-radius: 50%;
background-image: linear-gradient(to right,#bbb 50%,#333 0); background-image: linear-gradient(to right,#bbb 50%,#333 0);
border: 1px solid black;
margin: 0 0.2em; margin: 0 0.2em;
opacity: 0; opacity: 0;
animation: appear 20s step-start 1; animation: appear 20s step-start 1;
} }
.countdown:before, .countdown20:before, .countdown60:before { .countdown:before {
content: ''; content: '';
display: block; display: block;
margin-left: 50%; margin-left: 50%;
@ -382,11 +381,11 @@
transform-origin: 0 50%; transform-origin: 0 50%;
animation: rotate 10s linear 2, bg 20s step-end 1; animation: rotate 10s linear 2, bg 20s step-end 1;
} }
.countdown60 { .countdown[data-delay=60] {
animation: appear 60s step-start 1; animation-duration: 60s;
} }
.coutndown60:before { .countdown[data-delay=60]:before {
animation: rotate 30s linear 2, bg 60s step-end 1; animation-duration: 30s, 60s;
} }
@keyframes rotate { @keyframes rotate {
to { transform: rotate(.5turn); } to { transform: rotate(.5turn); }

View file

@ -10,7 +10,7 @@ mistplayers.dashjs = {
if ((options.host.substr(0,7) == 'http://') && (source.url.substr(0,8) == 'https://')) { return false; } if ((options.host.substr(0,7) == 'http://') && (source.url.substr(0,8) == 'https://')) { return false; }
return (('MediaSource' in window) && (location.protocol != 'file:')); return (('MediaSource' in window) && (location.protocol != 'file:'));
}, },
player: function(){} player: function(){this.onreadylist = [];}
}; };
var p = mistplayers.dashjs.player; var p = mistplayers.dashjs.player;
p.prototype = new MistPlayer(); p.prototype = new MistPlayer();

View file

@ -24,7 +24,7 @@ mistplayers.flash_strobe = {
return Number(version) >= Number(mimesplit[mimesplit.length-1]); return Number(version) >= Number(mimesplit[mimesplit.length-1]);
}, },
player: function(){} player: function(){this.onreadylist = [];}
}; };
var p = mistplayers.flash_strobe.player; var p = mistplayers.flash_strobe.player;
p.prototype = new MistPlayer(); p.prototype = new MistPlayer();

View file

@ -27,7 +27,9 @@ mistplayers.html5 = {
} catch(e){} } catch(e){}
return support; return support;
}, },
player: function(){}, player: function(){
this.onreadylist = [];
},
mistControls: true mistControls: true
}; };
var p = mistplayers.html5.player; var p = mistplayers.html5.player;

View file

@ -11,7 +11,7 @@ mistplayers.img = {
if ((options.forceType) || (options.forceSource) || (options.forcePlayer)) { return true; } if ((options.forceType) || (options.forceSource) || (options.forcePlayer)) { return true; }
return false; return false;
}, },
player: function(){} player: function(){this.onreadylist = [];}
}; };
var p = mistplayers.img.player; var p = mistplayers.img.player;
p.prototype = new MistPlayer(); p.prototype = new MistPlayer();

View file

@ -21,7 +21,7 @@ mistplayers.silverlight = {
return false; return false;
}, },
player: function(){} player: function(){this.onreadylist = [];}
}; };
var p = mistplayers.silverlight.player; var p = mistplayers.silverlight.player;
p.prototype = new MistPlayer(); p.prototype = new MistPlayer();

View file

@ -42,7 +42,7 @@ mistplayers.videojs = {
return ('MediaSource' in window); return ('MediaSource' in window);
}, },
player: function(){}, player: function(){this.onreadylist = [];}
}; };
var p = mistplayers.videojs.player; var p = mistplayers.videojs.player;
p.prototype = new MistPlayer(); p.prototype = new MistPlayer();

View file

@ -67,6 +67,7 @@ namespace Mist {
} }
void OutHTTP::onFail(){ void OutHTTP::onFail(){
std::string method = H.method;
// send logo icon // send logo icon
if (H.url.length() > 4 && H.url.substr(H.url.length() - 4, 4) == ".ico"){ if (H.url.length() > 4 && H.url.substr(H.url.length() - 4, 4) == ".ico"){
sendIcon(); sendIcon();
@ -90,7 +91,14 @@ namespace Mist {
H.Clean(); H.Clean();
H.SetBody("if (!mistvideo){var mistvideo = {};}\nmistvideo['" + streamName + "'] = "+json_resp.toString()+";\n"); H.SetBody("if (!mistvideo){var mistvideo = {};}\nmistvideo['" + streamName + "'] = "+json_resp.toString()+";\n");
} }
H.setCORSHeaders();
if(method == "OPTIONS" || method == "HEAD"){
H.SendResponse("200", "OK", myConn);
H.Clean();
return;
}
H.SendResponse("200", "Stream not found", myConn); H.SendResponse("200", "Stream not found", myConn);
H.Clean();
return; return;
} }
INFO_MSG("Failing: %s", H.url.c_str()); INFO_MSG("Failing: %s", H.url.c_str());