diff --git a/www/assets/js/ui.js b/www/assets/js/ui.js index 52a2966a..9e192611 100644 --- a/www/assets/js/ui.js +++ b/www/assets/js/ui.js @@ -181,6 +181,14 @@ function queue(pos) { } links.forEach(function(link) { var data = parseMediaLink(link); + if(data.id === null || data.type === null) { + makeAlert("Error", "Invalid link. Please double check it and remove extraneous information", "alert-error") + .addClass("span12") + .insertBefore($("#extended_controls")); + } + else { + $("#mediaurl").val(""); + } socket.emit("queue", { id: data.id, type: data.type, diff --git a/www/assets/js/util.js b/www/assets/js/util.js index cbf22148..5bba0d5e 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -807,6 +807,7 @@ function parseMediaLink(url) { }; } url = url.trim(); + url = url.replace("feature=player_embedded&", ""); if(url.indexOf("jw:") == 0) { return { @@ -899,6 +900,11 @@ function parseMediaLink(url) { type: "sc" }; } + + return { + id: null, + type: null + }; } function sendVideoUpdate() {