1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add requirejs

This commit is contained in:
Luke Pulverenti 2015-05-08 23:48:43 -04:00
parent 03ca18cf4f
commit 4e71751d0f
20 changed files with 379 additions and 520 deletions

View file

@ -30,10 +30,6 @@
var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3';
var cPlayer = {
deviceState: DEVICE_STATE.IDLE
};
var CastPlayer = function () {
/* device variables */
@ -531,7 +527,7 @@
};
// Create Cast Player
var castPlayer = new CastPlayer();
var castPlayer;
function chromecastPlayer() {
@ -843,15 +839,27 @@
};
}
MediaController.registerPlayer(new chromecastPlayer());
function initializeChromecast() {
$(MediaController).on('playerchange', function () {
castPlayer = new CastPlayer();
if (MediaController.getPlayerInfo().name == PlayerName) {
if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
castPlayer.launchApp();
MediaController.registerPlayer(new chromecastPlayer());
$(MediaController).on('playerchange', function () {
if (MediaController.getPlayerInfo().name == PlayerName) {
if (castPlayer.deviceState != DEVICE_STATE.ACTIVE && castPlayer.isInitialized) {
castPlayer.launchApp();
}
}
}
});
});
}
if ($.browser.chrome) {
requirejs(["thirdparty/cast_sender"], function () {
initializeChromecast();
});
}
})(window, window.chrome, console);