This commit is contained in:
calzoneman 2014-02-28 08:43:04 -06:00
parent 0f4c29952f
commit 5b793710c3
5 changed files with 18 additions and 84 deletions

View file

@ -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);
};
/**

View file

@ -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.");
}

View file

@ -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 = $("<li/>").appendTo($("#userpl_list"))
.addClass("well");
li.data("pl-name", pls[i].name);
$("<div/>").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;
$("<div/>").text(metastr)
.css("float", "right")
.appendTo(li);
var bg = $("<div/>").addClass("btn-group")
.css("float", "left")
.prependTo(li);
var del = $("<button/>")
.addClass("btn btn-xs btn-danger")
.prependTo(bg);
$("<span/>").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) {
$("<button/>").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) {
$("<button/>").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) {

View file

@ -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 = $("<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]);

View file

@ -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")
});
});
}