mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #896 - Chromecast icon needs to be displayed while playing videos on the web
This commit is contained in:
parent
b90c1fc868
commit
06c88752b1
4 changed files with 19 additions and 12 deletions
|
@ -551,15 +551,18 @@
|
|||
function updateCastIcon(context) {
|
||||
|
||||
var info = MediaController.getPlayerInfo();
|
||||
var btnCast = context.querySelector('.nowPlayingCastIcon');
|
||||
|
||||
if (info.isLocalPlayer) {
|
||||
|
||||
context.querySelector('.nowPlayingCastIcon').icon = 'cast';
|
||||
btnCast.icon = 'cast';
|
||||
btnCast.classList.remove('btnActiveCast');
|
||||
context.querySelector('.nowPlayingSelectedPlayer').innerHTML = '';
|
||||
|
||||
} else {
|
||||
|
||||
context.querySelector('.nowPlayingCastIcon').icon = 'cast-connected';
|
||||
btnCast.icon = 'cast-connected';
|
||||
btnCast.classList.add('btnActiveCast');
|
||||
context.querySelector('.nowPlayingSelectedPlayer').innerHTML = info.deviceName || info.name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -674,22 +674,24 @@
|
|||
|
||||
function updateCastIcon() {
|
||||
|
||||
var context = document;
|
||||
|
||||
var btnCast = context.querySelector('.btnCast');
|
||||
|
||||
var info = MediaController.getPlayerInfo();
|
||||
|
||||
if (info.isLocalPlayer) {
|
||||
|
||||
$('.btnCast').removeClass('btnActiveCast').each(function () {
|
||||
this.icon = 'cast';
|
||||
});
|
||||
$('.headerSelectedPlayer').html('');
|
||||
btnCast.icon = 'cast';
|
||||
btnCast.classList.remove('btnActiveCast');
|
||||
|
||||
context.querySelector('.headerSelectedPlayer').innerHTML = '';
|
||||
|
||||
} else {
|
||||
|
||||
$('.btnCast').addClass('btnActiveCast').each(function () {
|
||||
this.icon = 'cast-connected';
|
||||
});
|
||||
|
||||
$('.headerSelectedPlayer').html((info.deviceName || info.name));
|
||||
btnCast.icon = 'cast-connected';
|
||||
btnCast.classList.add('btnActiveCast');
|
||||
context.querySelector('.headerSelectedPlayer').innerHTML = info.deviceName || info.name;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function showPlayerSelection(button) {
|
||||
function showPlayerSelection(button, enableHistory) {
|
||||
|
||||
var playerInfo = MediaController.getPlayerInfo();
|
||||
|
||||
|
@ -101,6 +101,7 @@
|
|||
title: Globalize.translate('HeaderSelectPlayer'),
|
||||
items: menuItems,
|
||||
positionTo: button,
|
||||
enableHistory: enableHistory !== false,
|
||||
callback: function (id) {
|
||||
|
||||
var target = targets.filter(function (t) {
|
||||
|
|
|
@ -743,6 +743,7 @@
|
|||
|
||||
html += '<paper-slider pin step="1" min="0" max="100" value="0" class="videoVolumeSlider" style="width:100px;vertical-align:middle;margin-left:-1em;margin-right:2em;display:inline-block;"></paper-slider>';
|
||||
|
||||
html += '<paper-icon-button icon="cast" class="mediaButton castButton" onclick="MediaController.showPlayerSelection(this, false);" style="width:32px;height:32px;"></paper-icon-button>';
|
||||
html += '<paper-icon-button icon="fullscreen" class="mediaButton fullscreenButton" onclick="MediaPlayer.toggleFullscreen();" id="video-fullscreenButton"></paper-icon-button>';
|
||||
html += '<paper-icon-button icon="info" class="mediaButton infoButton" onclick="MediaPlayer.toggleInfo();"></paper-icon-button>';
|
||||
//html += '<paper-icon-button icon="dvr" class="mediaButton guideButton" onclick="MediaPlayer.toggleGuide();"></paper-icon-button>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue