Embed: fixed non-websocket only js syntax error; allowed HTML in error message

This commit is contained in:
Cat 2020-01-23 10:39:03 +01:00 committed by Thulinma
parent 573e945f5a
commit b5fcc4647c
3 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -286,10 +286,10 @@ function MistVideo(streamName,options) {
MistVideo.log("Stream info was loaded succesfully.");
if ("error" in d) {
var e = data.error;
var e = d.error;
if ("on_error" in d) {
MistVideo.log(e);
e = data.on_error;
e = d.on_error;
}
MistVideo.showError(e,{reload:true});
return;
@ -874,7 +874,7 @@ function MistVideo(streamName,options) {
MistVideo.container.setAttribute("data-loading","");
//listen for changes to the srteam status
//TODO switch to polling-mode if websockets are not supported
//switch to polling-mode if websockets are not supported
function openWithGet() {
var url = MistVideo.urlappend(options.host+"/json_"+encodeURIComponent(MistVideo.stream)+".js");

View file

@ -1709,7 +1709,8 @@ MistSkins["default"] = {
message_container.appendChild(p);
message_container.update = function(message){
MistUtil.empty(p);
p.appendChild(document.createTextNode(message));
//p.appendChild(document.createTextNode(message));
p.innerHTML = message; //allow custom html messages (configured in MI/HTTP/nostreamtext)
};
if (message) {
if (MistVideo.info.on_error) {
@ -1905,7 +1906,7 @@ MistSkins["default"] = {
container.clear();
}
};
container.clear = function(message){
container.clear = function(){
var countdowns = container.querySelectorAll("svg.icon.timeout");
for (var i = 0; i < countdowns.length; i++) {
MistVideo.timers.stop(countdowns[i].timeout);