dont show quality selector with default quality on non transcoded (#1670)

This commit is contained in:
mayeaux 2022-06-10 20:48:48 +02:00 committed by GitHub
parent 968db6652a
commit 2432cf2fe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

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

View file

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