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);
$("#queue_end").click(function() {
var parsed = parseVideoURL($("#mediaurl").val());
var id = parsed[0];
var type = parsed[1];
if(id) {
$("#mediaurl").val("");
var urls = $("#mediaurl").val().split(",");
for(var i = 0; i < urls.length; i++) {
if(!urls[i].trim())
continue;
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() {
var parsed = parseVideoURL($("#mediaurl").val());
var id = parsed[0];
var type = parsed[1];
if(id) {
$("#mediaurl").val("");
var urls = $("#mediaurl").val().split(",");
for(var i = 0; i < urls.length; i++) {
if(!urls[i].trim())
continue;
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() {