Fixed remotecontrol bug

This commit is contained in:
Kasper Rynning-Tønnesen
2015-06-25 11:43:10 +02:00
parent 24ec616da5
commit 5ac07f6dd0
5 changed files with 12 additions and 10 deletions

View File

@@ -61,7 +61,7 @@
<input type="range" title="Volume" id="volume-control" style="display:none;" min="0" value="100" max="100" />
</p>-->
<form action="#" class="row" id="base" onsubmit="window.location.href = '/remote/'+this.chan.value;return false;">
<form action="#" class="row" id="remoteform" onsubmit="return false;">
<div class="input-field col s12">
<input
class="input-field"

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
!function(){function e(){o?(t||(t=$("#code-input").val().toLowerCase()),$("#code-input").val(""),o=!1,$(".rc").css("display","block"),document.getElementById("base").setAttribute("onsubmit","control(); return false;"),$("#remote-text").text("Controlling "+t),document.getElementById("search").setAttribute("length","18"),document.getElementById("search").setAttribute("maxlength","18"),$("#forsearch").html("Type new channel name to change to"),$("#volume-control").slider({min:0,max:100,value:100,range:"min",animate:!0,stop:function(e,o){socket.emit("id",[t,"volume",o.value])}})):(socket.emit("id",[t,"channel",$("#search").val().toLowerCase()]),$("#search").val(""))}var t,o=!0;$(document).ready(function(){setTimeout(function(){$("#search").focus()},500),socket=io.connect("//"+window.location.hostname+":3000"),t=window.location.pathname.split("/")[2],t&&e()}),$("#playbutton").on("click",function(){socket.emit("id",[t,"play","mock"])}),$("#pausebutton").on("click",function(){socket.emit("id",[t,"pause","mock"])}),$("#skipbutton").on("click",function(){socket.emit("id",[t,"skip","mock"])})}();
!function(){function e(){o?(t||(t=$("#code-input").val().toLowerCase()),$("#code-input").val(""),o=!1,$(".rc").css("display","block"),$("#remote-text").text("Controlling "+t),document.getElementById("search").setAttribute("length","18"),document.getElementById("search").setAttribute("maxlength","18"),$("#forsearch").html("Type new channel name to change to"),$("#volume-control").slider({min:0,max:100,value:100,range:"min",animate:!0,stop:function(e,o){socket.emit("id",[t,"volume",o.value]),console.log("volume")}})):(socket.emit("id",[t,"channel",$("#search").val().toLowerCase()]),$("#search").val(""))}var t,o=!0;$(document).ready(function(){setTimeout(function(){$("#search").focus()},500),socket=io.connect("//"+window.location.hostname+":3000"),t=window.location.pathname.split("/")[2],t&&e()}),$("#playbutton").on("click",function(){socket.emit("id",[t,"play","mock"])}),$("#pausebutton").on("click",function(){socket.emit("id",[t,"pause","mock"])}),$("#skipbutton").on("click",function(){socket.emit("id",[t,"skip","mock"])}),$("#remoteform").on("submit",function(){o?window.location.href="/remote/"+document.getElementById("remoteform").chan.value:e()})}();

View File

@@ -18,7 +18,6 @@ var Hostcontroller = {
ytplayer.setVolume(arr[1]);
localStorage.setItem("volume", arr[1]);
Playercontrols.choose_button(arr[1], false);
ytplayer.loadVideoById('mockmaster');
}else if(arr[0] == "channel")
{
socket.emit("change_channel");
@@ -34,7 +33,7 @@ var Hostcontroller = {
else if(arr[0] == "play")
ytplayer.playVideo();
else if(arr[0] == "skip")
skip();
List.skip();
});
}
});

View File

@@ -27,11 +27,13 @@ $("#skipbutton").on("click", function()
socket.emit("id", [id, "skip", "mock"]);
});
/*
document.getElementById("volume-control").addEventListener("click", function()
$("#remoteform").on("submit", function()
{
socket.emit("id", [id, "volume", $("#volume-control").val()]);
});*/
if(start)
window.location.href = '/remote/'+document.getElementById("remoteform").chan.value;
else
control();
});
function control()
{
@@ -43,7 +45,7 @@ function control()
$(".rc").css("display", "block");
document.getElementById("base").setAttribute("onsubmit", "control(); return false;");
//document.getElementById("base").setAttribute("onsubmit", "control(); return false;");
$("#remote-text").text("Controlling "+ id)
document.getElementById("search").setAttribute("length", "18");
document.getElementById("search").setAttribute("maxlength", "18");
@@ -61,6 +63,7 @@ function control()
},*/
stop:function(event, ui) {
socket.emit("id", [id, "volume", ui.value]);
console.log("volume");
//console.log(ui.value);
}
});