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
|
* Generic error callback function
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.onError = function () {
|
CastPlayer.prototype.onError = function () {
|
||||||
console.log("error");
|
console.log("chromecast error");
|
||||||
$('.btnCast').hide();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,13 +146,11 @@
|
||||||
*/
|
*/
|
||||||
CastPlayer.prototype.receiverListener = function (e) {
|
CastPlayer.prototype.receiverListener = function (e) {
|
||||||
if (e === 'available') {
|
if (e === 'available') {
|
||||||
console.log("receiver found");
|
console.log("chromecast receiver found");
|
||||||
$('.btnCast').show();
|
|
||||||
this.hasReceivers = true;
|
this.hasReceivers = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("receiver list empty");
|
console.log("chromecast receiver list empty");
|
||||||
$('.btnCast').hide();
|
|
||||||
this.hasReceivers = false;
|
this.hasReceivers = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -686,7 +683,7 @@
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.btnCast').attr('title', this.castPlayerState + " on " + this.session.receiver.friendlyName);
|
// this.session.receiver.friendlyName
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -695,19 +692,15 @@
|
||||||
CastPlayer.prototype.updateMediaControlUI = function () {
|
CastPlayer.prototype.updateMediaControlUI = function () {
|
||||||
|
|
||||||
if (!chrome || !chrome.cast) {
|
if (!chrome || !chrome.cast) {
|
||||||
$('.btnCast').hide();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasReceivers) {
|
if (this.hasReceivers) {
|
||||||
$('.btnCast').show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.deviceState == DEVICE_STATE.ACTIVE) {
|
if (this.deviceState == DEVICE_STATE.ACTIVE) {
|
||||||
$('.btnCast').removeClass('btnDefaultCast').addClass('btnActiveCast');
|
|
||||||
var playerState = this.castPlayerState;
|
var playerState = this.castPlayerState;
|
||||||
} else {
|
} else {
|
||||||
$('.btnCast').removeClass('btnActiveCast').addClass('btnDefaultCast');
|
|
||||||
var playerState = this.localPlayerState;
|
var playerState = this.localPlayerState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -739,15 +732,6 @@
|
||||||
|
|
||||||
castPlayer.updateMediaControlUI();
|
castPlayer.updateMediaControlUI();
|
||||||
|
|
||||||
$('.btnCast', page).on('click', function () {
|
|
||||||
|
|
||||||
if (castPlayer.deviceState == DEVICE_STATE.ACTIVE) {
|
|
||||||
castPlayer.stopApp();
|
|
||||||
} else {
|
|
||||||
castPlayer.launchApp();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(window, window.chrome, console);
|
})(window, window.chrome, console);
|
Loading…
Add table
Add a link
Reference in a new issue