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

update chromecast

This commit is contained in:
Luke Pulverenti 2014-08-21 11:55:35 -04:00
parent f6995379a2
commit 3f09347bf7
8 changed files with 185 additions and 68 deletions

View file

@ -438,7 +438,7 @@
if (!mute) {
this.session.setReceiverVolumeLevel(vol || 1,
this.session.setReceiverVolumeLevel((vol || 1),
this.mediaCommandSuccessCallback.bind(this),
this.errorHandler);
}
@ -449,18 +449,6 @@
}
};
/**
* Toggle mute CC
*/
CastPlayer.prototype.toggleMute = function () {
if (this.audio == true) {
this.mute();
}
else {
this.unMute();
}
};
/**
* Mute CC
*/
@ -469,15 +457,6 @@
this.setReceiverVolume(true);
};
/**
* Unmute CC
*/
CastPlayer.prototype.unMute = function () {
this.audio = true;
this.setReceiverVolume(false);
};
/**
* media seek function in either Cast or local mode
* @param {Event} e An event object from seek
@ -684,11 +663,19 @@
};
self.unMute = function () {
castPlayer.unMute();
self.setVolume(getCurrentVolume() + 2);
};
self.toggleMute = function () {
castPlayer.toggleMute();
var state = self.lastPlayerData || {};
state = state.PlayState || {};
if (state.IsMuted) {
self.unMute();
} else {
self.mute();
}
};
self.getTargets = function () {
@ -724,7 +711,10 @@
"Mute",
"Unmute",
"ToggleMute",
"SetVolume"]
"SetVolume",
"SetAudioStreamIndex",
"SetSubtitleStreamIndex",
"DisplayContent"]
};
};
@ -732,6 +722,24 @@
castPlayer.seekMedia(position);
};
self.setAudioStreamIndex = function (index) {
castPlayer.sendMessage({
options: {
index: index
},
command: 'SetAudioStreamIndex'
});
};
self.setSubtitleStreamIndex = function (index) {
castPlayer.sendMessage({
options: {
index: index
},
command: 'SetSubtitleStreamIndex'
});
};
self.nextTrack = function () {
castPlayer.sendMessage({
options: {},