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 to = this.playlist.items.find(data);
var title = ""; var title = "";
if (to != null) { if (to !== false) {
title = " to " + to.media.title; 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") { req.header("user-agent").toLowerCase() === "zmeu") {
res.send("This server disallows requests from ZmEu."); res.send("This server disallows requests from ZmEu.");
} else { } 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 " + req.path + " looks pretty fishy to me. Double check that " +
"you typed it correctly."); "you typed it correctly.");
} }

View File

@ -811,6 +811,8 @@ Callbacks = {
return; return;
} }
var shouldResize = $("#ytapiplayer").html() === "";
if (PLAYER && typeof PLAYER.getVolume === "function") { if (PLAYER && typeof PLAYER.getVolume === "function") {
PLAYER.getVolume(function (v) { PLAYER.getVolume(function (v) {
if (typeof v === "number") { if (typeof v === "number") {
@ -865,6 +867,10 @@ Callbacks = {
loadMediaPlayer(data); loadMediaPlayer(data);
} }
if ($("#ytapiplayer").height() != VHEIGHT) {
resizeStuff();
}
handleMediaUpdate(data); handleMediaUpdate(data);
}, },
@ -1003,82 +1009,6 @@ Callbacks = {
listPlaylists: function(data) { listPlaylists: function(data) {
$("#userpl_list").data("entries", data); $("#userpl_list").data("entries", data);
formatUserPlaylistList(); 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) { emoteList: function (data) {

View File

@ -44,6 +44,7 @@ var YouTubePlayer = function (data) {
events: { events: {
onReady: function () { onReady: function () {
PLAYER.setVolume(VOLUME); PLAYER.setVolume(VOLUME);
$("#ytapiplayer").width(VWIDTH).height(VHEIGHT);
}, },
onStateChange: function (ev) { onStateChange: function (ev) {
if(PLAYER.paused && ev.data != YT.PlayerState.PAUSED || if(PLAYER.paused && ev.data != YT.PlayerState.PAUSED ||
@ -137,8 +138,6 @@ var VimeoPlayer = function (data) {
self.init = function () { self.init = function () {
var iframe = $("<iframe/>"); var iframe = $("<iframe/>");
removeOld(iframe); removeOld(iframe);
iframe.attr("width", VWIDTH);
iframe.attr("height", VHEIGHT);
var prto = location.protocol; var prto = location.protocol;
iframe.attr("src", prto+"//player.vimeo.com/video/"+self.videoId+"?api=1&player_id=ytapiplayer"); iframe.attr("src", prto+"//player.vimeo.com/video/"+self.videoId+"?api=1&player_id=ytapiplayer");
iframe.attr("webkitAllowFullScreen", ""); iframe.attr("webkitAllowFullScreen", "");
@ -147,6 +146,9 @@ var VimeoPlayer = function (data) {
if(USEROPTS.wmode_transparent) if(USEROPTS.wmode_transparent)
iframe.attr("wmode", "transparent"); iframe.attr("wmode", "transparent");
iframe.css("border", "none"); iframe.css("border", "none");
iframe.width(VWIDTH);
iframe.height(VHEIGHT);
console.log(iframe.width(), iframe.height());
$f(iframe[0]).addEvent("ready", function () { $f(iframe[0]).addEvent("ready", function () {
self.player = $f(iframe[0]); self.player = $f(iframe[0]);

View File

@ -2273,7 +2273,8 @@ function formatUserPlaylistList() {
.click(function () { .click(function () {
socket.emit("queuePlaylist", { socket.emit("queuePlaylist", {
name: pl.name, name: pl.name,
pos: "end" pos: "end",
temp: $(".add-temp").prop("checked")
}); });
}); });
} }
@ -2285,7 +2286,8 @@ function formatUserPlaylistList() {
.click(function () { .click(function () {
socket.emit("queuePlaylist", { socket.emit("queuePlaylist", {
name: pl.name, name: pl.name,
pos: "next" pos: "next",
temp: $(".add-temp").prop("checked")
}); });
}); });
} }