More fixes for current playing, and enabling remotecontroller if specified

This commit is contained in:
Kasper Rynning-Tønnesen
2017-06-15 18:42:18 +02:00
parent e76f9f59b5
commit a025953f3f
7 changed files with 42 additions and 15 deletions

View File

@@ -5,13 +5,17 @@ var Hostcontroller = {
old_id: null,
host_listener: function(id) {
if(Hostcontroller.old_id === null) Hostcontroller.old_id = id;
else {
socket.removeAllListeners(id);
began = false;
Hostcontroller.old_id = id;
}
if(embed) {
if(window.parentWindow && window.parentOrigin) {
window.parentWindow.postMessage({type: "controller", id: id}, window.parentOrigin);
}
}
var codeURL = "https://remote."+window.location.hostname+"/"+id;
$("#code-text").text(id);
$("#code-qr").attr("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
@@ -54,6 +58,7 @@ var Hostcontroller = {
change_enabled:function(val){
enabled = val;
document.getElementsByName("remote_switch")[0].checked = enabled;
console.log(enabled);
$(".remote_switch_class").prop("checked", enabled);
}
};