Skip to content

Commit

Permalink
fixes #896 - Chromecast icon needs to be displayed while playing vide…
Browse files Browse the repository at this point in the history
…os on the web
  • Loading branch information
LukePulverenti committed Feb 9, 2016
1 parent aa29793 commit 461ccdd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
20 changes: 11 additions & 9 deletions MediaBrowser.WebDashboard/dashboard-ui/scripts/librarymenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

} else {
context.querySelector('.headerSelectedPlayer').innerHTML = '';

$('.btnCast').addClass('btnActiveCast').each(function () {
this.icon = 'cast-connected';
});
} else {

$('.headerSelectedPlayer').html((info.deviceName || info.name));
btnCast.icon = 'cast-connected';
btnCast.classList.add('btnActiveCast');
context.querySelector('.headerSelectedPlayer').innerHTML = info.deviceName || info.name;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
});
}

function showPlayerSelection(button) {
function showPlayerSelection(button, enableHistory) {

var playerInfo = MediaController.getPlayerInfo();

Expand Down Expand Up @@ -101,6 +101,7 @@
title: Globalize.translate('HeaderSelectPlayer'),
items: menuItems,
positionTo: button,
enableHistory: enableHistory !== false,
callback: function (id) {

var target = targets.filter(function (t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
Expand Down

0 comments on commit 461ccdd

Please sign in to comment.