mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update osd
This commit is contained in:
parent
7c5dabe06d
commit
7d8f6339a2
3 changed files with 170 additions and 86 deletions
|
@ -414,13 +414,15 @@
|
|||
view.querySelector('.btnCast').classList.remove('hide');
|
||||
}
|
||||
|
||||
view.querySelector('.btnCast').addEventListener('click', function() {
|
||||
view.querySelector('.btnCast').addEventListener('click', function () {
|
||||
var btn = this;
|
||||
require(['playerSelectionMenu'], function (playerSelectionMenu) {
|
||||
playerSelectionMenu.show(btn);
|
||||
});
|
||||
});
|
||||
|
||||
view.querySelector('.btnSettings').addEventListener('click', onSettingsButtonClick);
|
||||
|
||||
function onPlayerChange() {
|
||||
|
||||
var player = playbackManager.getCurrentPlayer();
|
||||
|
@ -740,6 +742,60 @@
|
|||
elem.innerHTML = html;
|
||||
}
|
||||
|
||||
function onSettingsButtonClick(e) {
|
||||
|
||||
var btn = this;
|
||||
require(['qualityoptions', 'actionsheet'], function (qualityoptions, actionsheet) {
|
||||
|
||||
//var currentSrc = self.getCurrentSrc(self.currentMediaRenderer).toLowerCase();
|
||||
//var isStatic = currentSrc.indexOf('static=true') != -1;
|
||||
|
||||
var videoStream = lastPlayerState.MediaSource.MediaStreams.filter(function (stream) {
|
||||
return stream.Type == "Video";
|
||||
})[0];
|
||||
var videoWidth = videoStream ? videoStream.Width : null;
|
||||
|
||||
var options = qualityoptions.getVideoQualityOptions(lastPlayerState.MaxStreamingBitrate, videoWidth);
|
||||
|
||||
//if (isStatic) {
|
||||
// options[0].name = "Direct";
|
||||
//}
|
||||
|
||||
var menuItems = options.map(function (o) {
|
||||
|
||||
var opt = {
|
||||
name: o.name,
|
||||
id: o.bitrate
|
||||
};
|
||||
|
||||
if (o.selected) {
|
||||
opt.selected = true;
|
||||
}
|
||||
|
||||
return opt;
|
||||
});
|
||||
|
||||
var selectedId = options.filter(function (o) {
|
||||
return o.selected;
|
||||
});
|
||||
selectedId = selectedId.length ? selectedId[0].bitrate : null;
|
||||
actionsheet.show({
|
||||
items: menuItems,
|
||||
// history.back() will cause the video player to stop
|
||||
enableHistory: false,
|
||||
positionTo: btn,
|
||||
callback: function (id) {
|
||||
|
||||
var bitrate = parseInt(id);
|
||||
if (bitrate != selectedId) {
|
||||
//self.onQualityOptionSelected(bitrate);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function showAudioTrackSelection() {
|
||||
|
||||
var player = currentPlayer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue