Use videojs::http-streaming for all except iPhones

## Ticket
31: "quality selector not available on safari browsers"

## Notes
The quality selector isn't populated in some Apple products -- a known issue with videojs as the platform doesn't relay the info.

But it seems like only iPhone is affected, so let's enable the override for all platforms except iPhone.
This commit is contained in:
infinite-persistence 2022-04-25 14:41:20 +08:00 committed by Thomas Zarebczan
parent 1ad66fccd0
commit 7445063405
2 changed files with 6 additions and 8 deletions

View file

@ -160,18 +160,16 @@ export default React.memo<Props>(function VideoJs(props: Props) {
const isMobile = useIsMobile();
// will later store the videojs player
const playerRef = useRef();
const containerRef = useRef();
const tapToUnmuteRef = useRef();
const tapToRetryRef = useRef();
const playerServerRef = useRef();
const { url: livestreamVideoUrl } = activeLivestreamForChannel || {};
const overrideNativeVhs = !platform.isIPhone();
const showQualitySelector =
!isLivestreamClaim ||
(!isLivestreamClaim && overrideNativeVhs) ||
(livestreamVideoUrl && (livestreamVideoUrl.includes('/transcode/') || livestreamVideoUrl.includes('cloud.odysee')));
// initiate keyboard shortcuts
@ -214,7 +212,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
controls: true,
html5: {
vhs: {
overrideNative: !videojs.browser.IS_ANY_SAFARI,
overrideNative: overrideNativeVhs, // !videojs.browser.IS_ANY_SAFARI,
enableLowInitialPlaylist: false,
fastQualityChange: true,
useDtsForTimestampOffset: true,

View file

@ -203,9 +203,9 @@ export const platform = {
// return (/ipad/gi).test(navigator.platform);
// },
// isIPhone: function() { << untested
// return (/iphone/gi).test(navigator.platform);
// },
isIPhone: function () {
return /iphone/gi.test(navigator.platform);
},
// isLandscape: function() { << I think window.orientation makes more sense
// return window.innerHeight < window.innerWidth;