Allow comma-separated URLs in queue box

This commit is contained in:
calzoneman 2013-04-12 13:02:57 -05:00
parent d5ce1020b2
commit 4e2702f65f

View file

@ -125,31 +125,41 @@ setInterval(function() {
}, 5000); }, 5000);
$("#queue_end").click(function() { $("#queue_end").click(function() {
var parsed = parseVideoURL($("#mediaurl").val()); var urls = $("#mediaurl").val().split(",");
var id = parsed[0]; for(var i = 0; i < urls.length; i++) {
var type = parsed[1]; if(!urls[i].trim())
if(id) { continue;
$("#mediaurl").val(""); var parsed = parseVideoURL(urls[i].trim());
var id = parsed[0];
var type = parsed[1];
if(id) {
$("#mediaurl").val("");
}
socket.emit("queue", {
id: id,
pos: "end",
type: type
});
} }
socket.emit("queue", {
id: id,
pos: "end",
type: type
});
}); });
$("#queue_next").click(function() { $("#queue_next").click(function() {
var parsed = parseVideoURL($("#mediaurl").val()); var urls = $("#mediaurl").val().split(",");
var id = parsed[0]; for(var i = 0; i < urls.length; i++) {
var type = parsed[1]; if(!urls[i].trim())
if(id) { continue;
$("#mediaurl").val(""); var parsed = parseVideoURL(urls[i].trim());
var id = parsed[0];
var type = parsed[1];
if(id) {
$("#mediaurl").val("");
}
socket.emit("queue", {
id: id,
pos: "next",
type: type
});
} }
socket.emit("queue", {
id: id,
pos: "next",
type: type
});
}); });
$("#play_next").click(function() { $("#play_next").click(function() {