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

added chromecast icon

This commit is contained in:
Luke Pulverenti 2014-02-23 12:29:02 -05:00
parent 3d0e125dd3
commit 869717c745
16 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,18 @@
.btnCast {
width: 28px;
height: 28px;
padding: 0;
background-color: transparent;
border: 0;
background-size: 100%;
vertical-align: middle;
margin: 0 .6em;
}
.btnDefaultCast {
background-image: url(images/chromecast/ic_notification_media_route.png);
}
.btnActiveCast {
background-image: url(images/chromecast/ic_media_route_on_holo_dark.png);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

View file

@ -82,7 +82,12 @@
*/ */
CastPlayer.prototype.initializeCastPlayer = function () { CastPlayer.prototype.initializeCastPlayer = function () {
if (!chrome) {
return;
}
if (!chrome.cast || !chrome.cast.isAvailable) { if (!chrome.cast || !chrome.cast.isAvailable) {
setTimeout(this.initializeCastPlayer.bind(this), 1000);
return; return;
} }
@ -94,6 +99,8 @@
this.sessionListener.bind(this), this.sessionListener.bind(this),
this.receiverListener.bind(this)); this.receiverListener.bind(this));
console.log('chrome.cast.initialize');
chrome.cast.initialize(apiConfig, this.onInitSuccess.bind(this), this.onError.bind(this)); chrome.cast.initialize(apiConfig, this.onInitSuccess.bind(this), this.onError.bind(this));
}; };
@ -102,6 +109,7 @@
*/ */
CastPlayer.prototype.onInitSuccess = function () { CastPlayer.prototype.onInitSuccess = function () {
console.log("init success"); console.log("init success");
$('.btnCast').show();
this.updateMediaControlUI(); this.updateMediaControlUI();
}; };
@ -110,6 +118,7 @@
*/ */
CastPlayer.prototype.onError = function () { CastPlayer.prototype.onError = function () {
console.log("error"); console.log("error");
$('.btnCast').hide();
}; };
/** /**
@ -306,6 +315,36 @@
//this.updateDisplayMessage(); //this.updateDisplayMessage();
}; };
/**
* Update media control UI components based on localPlayerState or castPlayerState
*/
CastPlayer.prototype.updateMediaControlUI = function() {
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;
}
switch (playerState) {
case PLAYER_STATE.LOADED:
case PLAYER_STATE.PLAYING:
//document.getElementById("play").style.display = 'none';
//document.getElementById("pause").style.display = 'block';
break;
case PLAYER_STATE.PAUSED:
case PLAYER_STATE.IDLE:
case PLAYER_STATE.LOADING:
case PLAYER_STATE.STOPPED:
//document.getElementById("play").style.display = 'block';
//document.getElementById("pause").style.display = 'none';
break;
default:
break;
}
};
window.CastPlayer = CastPlayer; window.CastPlayer = CastPlayer;
$(function() { $(function() {

View file

@ -24,6 +24,8 @@
html += '<div class="viewMenuSecondary">'; html += '<div class="viewMenuSecondary">';
html += '<button class="btnCast btnDefaultCast" type="button" data-role="none" style="display:none;"></button>';
html += '<a class="viewMenuLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout(this);">'; html += '<a class="viewMenuLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout(this);">';
if (user.PrimaryImageTag) { if (user.PrimaryImageTag) {