From dca6c2ebf8ad5dd0e96532b0c081330c79e36104 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Thu, 14 Apr 2022 10:17:14 +0800 Subject: [PATCH] Disable "switch optimized-auto to original" for now. It might be a user option in the future. --- ui/component/viewers/videoViewer/view.jsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index adc37737f..ddd068d9d 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -33,6 +33,8 @@ import { lastBandwidthSelector } from './internal/plugins/videojs-http-streaming // const PLAY_TIMEOUT_LIMIT = 2000; const PLAY_POSITION_SAVE_INTERVAL_MS = 15000; +const USE_ORIGINAL_STREAM_FOR_OPTIMIZED_AUTO = false; + type Props = { position: number, changeVolume: (number) => void, @@ -384,13 +386,15 @@ function VideoViewer(props: Props) { player.on('loadedmetadata', () => restorePlaybackRate(player)); // Override "auto" to use non-vhs url when the quality matches. - player.on('loadedmetadata', () => { - const vhs = player.tech(true).vhs; - if (vhs) { - // https://github.com/videojs/http-streaming/issues/749#issuecomment-606972884 - vhs.selectPlaylist = lastBandwidthSelector; - } - }); + if (USE_ORIGINAL_STREAM_FOR_OPTIMIZED_AUTO) { + player.on('loadedmetadata', () => { + const vhs = player.tech(true).vhs; + if (vhs) { + // https://github.com/videojs/http-streaming/issues/749#issuecomment-606972884 + vhs.selectPlaylist = lastBandwidthSelector; + } + }); + } // used for tracking buffering for watchman player.on('tracking:buffered', doTrackingBuffered);