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

update video osd

This commit is contained in:
Luke Pulverenti 2017-01-25 02:04:34 -05:00
parent 93ce8f975b
commit 9511b02112
4 changed files with 36 additions and 56 deletions

View file

@ -763,52 +763,13 @@
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 = playbackManager.currentMediaSource(currentPlayer).MediaStreams.filter(function (stream) {
return stream.Type === "Video";
})[0];
var videoWidth = videoStream ? videoStream.Width : null;
var options = qualityoptions.getVideoQualityOptions(playbackManager.getMaxStreamingBitrate(currentPlayer), 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;
require(['playerSettingsMenu'], function (playerSettingsMenu) {
playerSettingsMenu.show({
mediaType: 'Video',
player: currentPlayer,
positionTo: btn
});
var selectedId = options.filter(function (o) {
return o.selected;
});
selectedId = selectedId.length ? selectedId[0].bitrate : null;
actionsheet.show({
items: menuItems,
positionTo: btn,
callback: function (id) {
var bitrate = parseInt(id);
if (bitrate !== selectedId) {
playbackManager.setMaxStreamingBitrate(bitrate, currentPlayer);
}
}
});
});
}