From 2dbb5917c38ecf6323bfdc2518a233bde022282d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 1 Feb 2016 15:41:56 -0500 Subject: [PATCH] fix quality options --- .../dashboard-ui/scripts/mediaplayer-video.js | 1 + .../dashboard-ui/scripts/mediaplayer.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer-video.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer-video.js index 8d6e2c59ff..690ebfbeab 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer-video.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer-video.js @@ -613,6 +613,7 @@ self.onQualityOptionSelected = function (bitrate) { AppSettings.maxStreamingBitrate(bitrate); + AppSettings.enableAutomaticBitrateDetection(false); self.changeStream(self.getCurrentTicks(), { Bitrate: bitrate diff --git a/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer.js b/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer.js index 581ed61bb5..e4f09d9ef7 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer.js +++ b/MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer.js @@ -187,7 +187,15 @@ return new Promise(function (resolve, reject) { - require(['browserdeviceprofile'], function (profile) { + require(['browserdeviceprofile', 'qualityoptions'], function (profile, qualityoptions) { + + var bitrateSetting = AppSettings.maxStreamingBitrate(); + + if (!maxHeight) { + maxHeight = qualityoptions.getVideoQualityOptions(bitrateSetting).filter(function (q) { + return q.selected; + })[0].maxHeight; + } if (AppInfo.isNativeApp && browserInfo.android) { updateDeviceProfileForAndroid(profile); @@ -195,6 +203,9 @@ else if (AppInfo.isNativeApp && browserInfo.safari) { updateDeviceProfileForIOS(profile); } + + profile.MaxStreamingBitrate = bitrateSetting; + resolve(profile); }); });