Finish refactoring player [untested]
This commit is contained in:
parent
39ea0c9207
commit
3a5de93d7c
3 changed files with 331 additions and 307 deletions
|
|
@ -853,30 +853,23 @@ 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?
|
||||
$("<div/>").attr("id", "ytapiplayer")
|
||||
.insertBefore($("#ytapiplayer_wrapper"));
|
||||
$("#ytapiplayer_wrapper").remove();
|
||||
}
|
||||
|
||||
if(data.type != PLAYER.type) {
|
||||
if(data.type === "vi" && typeof $f !== "function") {
|
||||
setTimeout(function () {
|
||||
Callbacks.changeMedia(data);
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
PLAYER = new Player(data);
|
||||
}
|
||||
if(PLAYER.update) {
|
||||
PLAYER.update(data);
|
||||
loadMediaPlayer(data);
|
||||
}
|
||||
|
||||
handleMediaUpdate(data);
|
||||
},
|
||||
|
||||
mediaUpdate: function(data) {
|
||||
if(PLAYER.update) {
|
||||
PLAYER.update(data);
|
||||
}
|
||||
handleMediaUpdate(data);
|
||||
},
|
||||
|
||||
setPlaylistLocked: function(data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue