mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
re-enable chromecast, although it's not doing anything yet
This commit is contained in:
parent
ea0eb5c207
commit
121107918d
1 changed files with 4 additions and 20 deletions
|
@ -118,8 +118,7 @@
|
|||
* Generic error callback function
|
||||
*/
|
||||
CastPlayer.prototype.onError = function () {
|
||||
console.log("error");
|
||||
$('.btnCast').hide();
|
||||
console.log("chromecast error");
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -147,13 +146,11 @@
|
|||
*/
|
||||
CastPlayer.prototype.receiverListener = function (e) {
|
||||
if (e === 'available') {
|
||||
console.log("receiver found");
|
||||
$('.btnCast').show();
|
||||
console.log("chromecast receiver found");
|
||||
this.hasReceivers = true;
|
||||
}
|
||||
else {
|
||||
console.log("receiver list empty");
|
||||
$('.btnCast').hide();
|
||||
console.log("chromecast receiver list empty");
|
||||
this.hasReceivers = false;
|
||||
}
|
||||
};
|
||||
|
@ -686,7 +683,7 @@
|
|||
} else {
|
||||
}
|
||||
|
||||
$('.btnCast').attr('title', this.castPlayerState + " on " + this.session.receiver.friendlyName);
|
||||
// this.session.receiver.friendlyName
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -695,19 +692,15 @@
|
|||
CastPlayer.prototype.updateMediaControlUI = function () {
|
||||
|
||||
if (!chrome || !chrome.cast) {
|
||||
$('.btnCast').hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.hasReceivers) {
|
||||
$('.btnCast').show();
|
||||
}
|
||||
|
||||
if (this.deviceState == DEVICE_STATE.ACTIVE) {
|
||||
$('.btnCast').removeClass('btnDefaultCast').addClass('btnActiveCast');
|
||||
var playerState = this.castPlayerState;
|
||||
} else {
|
||||
$('.btnCast').removeClass('btnActiveCast').addClass('btnDefaultCast');
|
||||
var playerState = this.localPlayerState;
|
||||
}
|
||||
|
||||
|
@ -739,15 +732,6 @@
|
|||
|
||||
castPlayer.updateMediaControlUI();
|
||||
|
||||
$('.btnCast', page).on('click', function () {
|
||||
|
||||
if (castPlayer.deviceState == DEVICE_STATE.ACTIVE) {
|
||||
castPlayer.stopApp();
|
||||
} else {
|
||||
castPlayer.launchApp();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(window, window.chrome, console);
|
Loading…
Add table
Add a link
Reference in a new issue