Disable "switch optimized-auto to original" for now.

It might be a user option in the future.
This commit is contained in:
infinite-persistence 2022-04-14 10:17:14 +08:00 committed by Thomas Zarebczan
parent 257011b62d
commit dca6c2ebf8

View file

@ -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);