mirror of https://github.com/calzoneman/sync.git
Add notification when queueing jwplayer
This commit is contained in:
parent
3ebf4a1009
commit
cfd70cff12
|
@ -622,6 +622,12 @@ Callbacks = {
|
||||||
if(data.type != "sc" && PLAYER.type == "sc")
|
if(data.type != "sc" && PLAYER.type == "sc")
|
||||||
// [](/goddamnitmango)
|
// [](/goddamnitmango)
|
||||||
fixSoundcloudShit();
|
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) {
|
if(data.type != PLAYER.type) {
|
||||||
PLAYER = new Media(data);
|
PLAYER = new Media(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,12 @@ function queueEnd() {
|
||||||
if(id) {
|
if(id) {
|
||||||
$("#mediaurl").val("");
|
$("#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", {
|
socket.emit("queue", {
|
||||||
id: id,
|
id: id,
|
||||||
pos: "end",
|
pos: "end",
|
||||||
|
@ -173,7 +179,7 @@ $("#mediaurl").keydown(function(ev) {
|
||||||
|
|
||||||
$("#queue_next").click(function() {
|
$("#queue_next").click(function() {
|
||||||
var urls = $("#mediaurl").val().split(",");
|
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())
|
if(!urls[i].trim())
|
||||||
continue;
|
continue;
|
||||||
var parsed = parseVideoURL(urls[i].trim());
|
var parsed = parseVideoURL(urls[i].trim());
|
||||||
|
@ -182,6 +188,12 @@ $("#queue_next").click(function() {
|
||||||
if(id) {
|
if(id) {
|
||||||
$("#mediaurl").val("");
|
$("#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", {
|
socket.emit("queue", {
|
||||||
id: id,
|
id: id,
|
||||||
pos: "next",
|
pos: "next",
|
||||||
|
|
|
@ -381,6 +381,12 @@ Media.prototype.initRTMP = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Media.prototype.initJWPlayer = function() {
|
Media.prototype.initJWPlayer = function() {
|
||||||
|
if(typeof jwplayer == "undefined") {
|
||||||
|
setTimeout(function() {
|
||||||
|
this.initJWPlayer();
|
||||||
|
}.bind(this), 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.removeOld();
|
this.removeOld();
|
||||||
|
|
||||||
jwplayer("ytapiplayer").setup({
|
jwplayer("ytapiplayer").setup({
|
||||||
|
@ -400,15 +406,6 @@ Media.prototype.initJWPlayer = function() {
|
||||||
socket.emit("playNext");
|
socket.emit("playNext");
|
||||||
});
|
});
|
||||||
|
|
||||||
function removeLogo() {
|
|
||||||
if($("#ytapiplayer_logo").length > 0) {
|
|
||||||
$("#ytapiplayer_logo").remove();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
setTimeout(removeLogo, 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.load = function(data) {
|
this.load = function(data) {
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
this.initJWPlayer();
|
this.initJWPlayer();
|
||||||
|
|
Loading…
Reference in New Issue