diff --git a/lib/channel.js b/lib/channel.js index 132ce809..9962e33c 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -2048,11 +2048,11 @@ Channel.prototype.handleJumpTo = function (user, data) { var to = this.playlist.items.find(data); var title = ""; - if (to != null) { + if (to !== false) { title = " to " + to.media.title; + this.logger.log("[playlist] " + user.name + " skipped" + title); + this.playlist.jump(data); } - this.logger.log("[playlist] " + user.name + " skipped" + title); - this.playlist.jump(data); }; /** diff --git a/lib/web/webserver.js b/lib/web/webserver.js index 26ae10f8..818d74f8 100644 --- a/lib/web/webserver.js +++ b/lib/web/webserver.js @@ -231,7 +231,7 @@ function static(dir) { req.header("user-agent").toLowerCase() === "zmeu") { res.send("This server disallows requests from ZmEu."); } else { - res.send("The request " + req.route.method.toUpperCase() + " " + + res.send("The request " + req.method.toUpperCase() + " " + req.path + " looks pretty fishy to me. Double check that " + "you typed it correctly."); } diff --git a/www/js/callbacks.js b/www/js/callbacks.js index 59cc34a6..11ba5ab6 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -811,6 +811,8 @@ Callbacks = { return; } + var shouldResize = $("#ytapiplayer").html() === ""; + if (PLAYER && typeof PLAYER.getVolume === "function") { PLAYER.getVolume(function (v) { if (typeof v === "number") { @@ -865,6 +867,10 @@ Callbacks = { loadMediaPlayer(data); } + if ($("#ytapiplayer").height() != VHEIGHT) { + resizeStuff(); + } + handleMediaUpdate(data); }, @@ -1003,82 +1009,6 @@ Callbacks = { listPlaylists: function(data) { $("#userpl_list").data("entries", data); formatUserPlaylistList(); - return; - if(data.error) { - makeAlert("Error", data.error, "alert-danger") - .insertBefore($("#userpl_list")); - } - else { - var pls = data; - pls.sort(function(a, b) { - var x = a.name.toLowerCase(); - var y = b.name.toLowerCase(); - if(x < y) return -1; - if(x > y) return 1; - return 0; - }); - $("#userpl_list").html(""); - for(var i = 0; i < pls.length; i++) { - var li = $("
").appendTo($("#userpl_list")) - .addClass("well"); - li.data("pl-name", pls[i].name); - $("").text(pls[i].name).appendTo(li) - .css("float", "left") - .css("margin-left", "1em"); - var metastr = pls[i].count + " item"; - if(pls[i].count != 1) { - metastr += "s"; - } - metastr +=", playtime " + pls[i].duration; - $("").text(metastr) - .css("float", "right") - .appendTo(li); - var bg = $("").addClass("btn-group") - .css("float", "left") - .prependTo(li); - var del = $("") - .addClass("btn btn-xs btn-danger") - .prependTo(bg); - $("").addClass("glyphicon glyphicon-trash").appendTo(del); - (function(li) { - del.click(function() { - var go = confirm("Are you sure you want to delete playlist '" + li.data("pl-name") + "'?"); - if(go) { - socket.emit("deletePlaylist", { - name: li.data("pl-name") - }); - } - }); - })(li); - if(hasPermission("playlistaddlist")) { - (function(li) { - $("").addClass("btn btn-xs btn-default") - .text("End") - .prependTo(bg) - .click(function() { - socket.emit("queuePlaylist", { - name: li.data("pl-name"), - pos: "end" - }); - }); - })(li); - - if(hasPermission("playlistnext")) { - (function(li) { - $("").addClass("btn btn-xs btn-default") - .text("Next") - .prependTo(bg) - .click(function() { - socket.emit("queuePlaylist", { - name: li.data("pl-name"), - pos: "next" - }); - }); - })(li); - } - } - } - } }, emoteList: function (data) { diff --git a/www/js/player.js b/www/js/player.js index f032e085..ee129dde 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -44,6 +44,7 @@ var YouTubePlayer = function (data) { events: { onReady: function () { PLAYER.setVolume(VOLUME); + $("#ytapiplayer").width(VWIDTH).height(VHEIGHT); }, onStateChange: function (ev) { if(PLAYER.paused && ev.data != YT.PlayerState.PAUSED || @@ -137,8 +138,6 @@ var VimeoPlayer = function (data) { self.init = function () { var iframe = $(""); removeOld(iframe); - iframe.attr("width", VWIDTH); - iframe.attr("height", VHEIGHT); var prto = location.protocol; iframe.attr("src", prto+"//player.vimeo.com/video/"+self.videoId+"?api=1&player_id=ytapiplayer"); iframe.attr("webkitAllowFullScreen", ""); @@ -147,6 +146,9 @@ var VimeoPlayer = function (data) { if(USEROPTS.wmode_transparent) iframe.attr("wmode", "transparent"); iframe.css("border", "none"); + iframe.width(VWIDTH); + iframe.height(VHEIGHT); + console.log(iframe.width(), iframe.height()); $f(iframe[0]).addEvent("ready", function () { self.player = $f(iframe[0]); diff --git a/www/js/util.js b/www/js/util.js index 20fda2f7..b7a4d61e 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2273,7 +2273,8 @@ function formatUserPlaylistList() { .click(function () { socket.emit("queuePlaylist", { name: pl.name, - pos: "end" + pos: "end", + temp: $(".add-temp").prop("checked") }); }); } @@ -2285,7 +2286,8 @@ function formatUserPlaylistList() { .click(function () { socket.emit("queuePlaylist", { name: pl.name, - pos: "next" + pos: "next", + temp: $(".add-temp").prop("checked") }); }); }