jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/playback/playersettingsmenu.js
Luke Pulverenti 8a6884abef minify
2017-01-27 18:07:14 -05:00

1 line
1.0 KiB
JavaScript

define(["actionsheet","datetime","playbackManager","globalize","appSettings","qualityoptions"],function(actionsheet,datetime,playbackManager,globalize,appSettings,qualityoptions){"use strict";function showQualityMenu(player,btn){var videoStream=playbackManager.currentMediaSource(player).MediaStreams.filter(function(stream){return"Video"===stream.Type})[0],videoWidth=videoStream?videoStream.Width:null,options=qualityoptions.getVideoQualityOptions(playbackManager.getMaxStreamingBitrate(player),videoWidth),menuItems=options.map(function(o){var opt={name:o.name,id:o.bitrate};return o.selected&&(opt.selected=!0),opt}),selectedId=options.filter(function(o){return o.selected});return selectedId=selectedId.length?selectedId[0].bitrate:null,actionsheet.show({items:menuItems,positionTo:btn}).then(function(id){var bitrate=parseInt(id);bitrate!==selectedId&&playbackManager.setMaxStreamingBitrate(bitrate,player)})}function show(options){var player=options.player;options.mediaType;return showQualityMenu(player,options.positionTo)}return{show:show}});