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

update cast icon visibility

This commit is contained in:
Luke Pulverenti 2014-02-23 12:53:25 -05:00
parent 869717c745
commit fd80cb3da5

View file

@ -109,7 +109,6 @@
*/
CastPlayer.prototype.onInitSuccess = function () {
console.log("init success");
$('.btnCast').show();
this.updateMediaControlUI();
};
@ -319,6 +318,13 @@
* Update media control UI components based on localPlayerState or castPlayerState
*/
CastPlayer.prototype.updateMediaControlUI = function () {
if (!chrome || !chrome.cast) {
$('.btnCast').hide();
return;
}
$('.btnCast').show();
if (this.deviceState == DEVICE_STATE.ACTIVE) {
$('.btnCast').removeClass('btnDefaultCast').addClass('btnActiveCast');
var playerState = this.castPlayerState;
@ -351,6 +357,10 @@
var castPlayer = new CastPlayer();
$(document).on('pagebeforeshow', ".libraryPage", function () {
castPlayer.updateMediaControlUI();
});
});
})(window, window.chrome, console);