From 2432cf2fe174e7dd902b92b9b7c04d4a9bd9bd88 Mon Sep 17 00:00:00 2001 From: mayeaux Date: Fri, 10 Jun 2022 20:48:48 +0200 Subject: [PATCH] dont show quality selector with default quality on non transcoded (#1670) --- .../internal/plugins/videojs-hls-quality-selector/plugin.js | 4 +++- ui/component/viewers/videoViewer/view.jsx | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js b/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js index 2eca32632..58a065c44 100644 --- a/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js +++ b/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js @@ -46,9 +46,11 @@ class HlsQualitySelectorPlugin { // Listen for source changes this.player.on('loadedmetadata', (e) => { + const { qualityToSet, switchedFromDefaultQuality, claimSrcVhs } = this.player; + // if there was a quality option selected to default to, set it using the setQuality function // as if it was being clicked on, on loadedmetadata - if (this.player.qualityToSet && !this.player.switchedFromDefaultQuality) { + if (qualityToSet && !switchedFromDefaultQuality && claimSrcVhs) { this.setQuality(this.player.qualityToSet); // Add this attribute to the video player so later it can be checked and avoid switching again diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index b0bdc85bd..9d504588d 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -229,9 +229,11 @@ function VideoViewer(props: Props) { [collectionId, doPlayUri, isFloating, push] ); + /** handle play next/play previous buttons **/ useEffect(() => { if (!doNavigate) return; + // playNextUrl is set (either true or false) when the Next/Previous buttons are clicked const shouldPlayNextUrl = playNextUrl && nextRecommendedUri && permanentUrl !== nextRecommendedUri; const shouldPlayPreviousUrl = !playNextUrl && previousListUri && permanentUrl !== previousListUri;