Add notification when queueing jwplayer

This commit is contained in:
calzoneman 2013-06-02 19:37:48 -04:00
parent 3ebf4a1009
commit cfd70cff12
3 changed files with 25 additions and 10 deletions

View File

@ -622,6 +622,12 @@ Callbacks = {
if(data.type != "sc" && PLAYER.type == "sc")
// [](/goddamnitmango)
fixSoundcloudShit();
if(data.type != "jw" && PLAYER.type == "jw") {
// Is it so hard to not mess up my DOM?
var wtf = $("<div/>").attr("id", "ytapiplayer")
.insertBefore($("#ytapiplayer_wrapper"));
$("#ytapiplayer_wrapper").remove();
}
if(data.type != PLAYER.type) {
PLAYER = new Media(data);
}

View File

@ -157,6 +157,12 @@ function queueEnd() {
if(id) {
$("#mediaurl").val("");
}
if(type == "jw") {
makeAlert("JWPlayer",
"If you are queueing a file (not a livestream) with JWPlayer, please note it will only synchronize if you assign a leader.",
"alert-warning")
.insertAfter($("#playlist_controls"));
}
socket.emit("queue", {
id: id,
pos: "end",
@ -173,7 +179,7 @@ $("#mediaurl").keydown(function(ev) {
$("#queue_next").click(function() {
var urls = $("#mediaurl").val().split(",");
for(var i = 0; i < urls.length; i++) {
for(var i = urls.length - 1; i >= 0; i--) {
if(!urls[i].trim())
continue;
var parsed = parseVideoURL(urls[i].trim());
@ -182,6 +188,12 @@ $("#queue_next").click(function() {
if(id) {
$("#mediaurl").val("");
}
if(type == "jw") {
makeAlert("JWPlayer",
"If you are queueing a file (not a livestream) with JWPlayer, please note it will only synchronize if you assign a leader.",
"alert-warning")
.insertAfter($("#playlist_controls"));
}
socket.emit("queue", {
id: id,
pos: "next",

View File

@ -381,6 +381,12 @@ Media.prototype.initRTMP = function() {
}
Media.prototype.initJWPlayer = function() {
if(typeof jwplayer == "undefined") {
setTimeout(function() {
this.initJWPlayer();
}.bind(this), 100);
return;
}
this.removeOld();
jwplayer("ytapiplayer").setup({
@ -400,15 +406,6 @@ Media.prototype.initJWPlayer = function() {
socket.emit("playNext");
});
function removeLogo() {
if($("#ytapiplayer_logo").length > 0) {
$("#ytapiplayer_logo").remove();
}
else {
setTimeout(removeLogo, 100);
}
}
this.load = function(data) {
this.id = data.id;
this.initJWPlayer();