Fixed hostcontroller and removed an errormessage that appears on channels with one song only

This commit is contained in:
Kasper Rynning-Tønnesen
2016-02-10 13:03:34 +01:00
parent f6ce377161
commit f1f265a69c
8 changed files with 20 additions and 15 deletions

View File

@@ -3,7 +3,7 @@ var Hostcontroller = {
enabled: true,
host_listener: function() {
var old_id;
socket.on("id", function(id)
@@ -51,7 +51,7 @@ var Hostcontroller = {
}else if(arr[0] == "pause")
Youtube.ytplayer.pauseVideo()
else if(arr[0] == "play")
YouTube.ytplayer.playVideo();
Youtube.ytplayer.playVideo();
else if(arr[0] == "skip")
List.skip();
}

View File

@@ -106,12 +106,14 @@ var List = {
full_playlist[0].added = time;
full_playlist[length].now_playing = false;
full_playlist.push(full_playlist.shift());
$("#wrapper").children()[0].remove();
try{
full_playlist.push(full_playlist.shift());
$("#wrapper").children()[0].remove();
List.insertAtIndex(full_playlist[length-1], false);
document.getElementById('wrapper').scrollTop += 1;
document.getElementById('wrapper').scrollTop += -1;
List.insertAtIndex(full_playlist[length-1], false);
document.getElementById('wrapper').scrollTop += 1;
document.getElementById('wrapper').scrollTop += -1;
}catch(e){}
},
vote: function(id, vote){

View File

@@ -406,10 +406,12 @@ function onepage_load(){
Youtube.stopInterval = true;
Admin.display_logged_out();
Admin.beginning = true;
chan = "";
Admin.beginning = true;
chan = "";
began = false;
$("#embed-button").css("display", "none");
socket.removeAllListeners();
$.ajax({

View File

@@ -13,11 +13,12 @@ $(document).ready(function (){
'sync disconnect on unload':true,
'secure': true
};
socket = io.connect('https://zoff.no:8880', connection_options);
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = "localhost";
socket = io.connect(add + ':8880', connection_options);
id = window.location.pathname.split("/")[1];
if(id)
{
console.log("remote exists");
id = id.toLowerCase();
Remotecontroller.control();
}