Dynamically detect if full screen is supported (#13197)

This commit is contained in:
Nicolas Mowen
2024-08-19 15:01:21 -06:00
committed by GitHub
parent 38a8d34ba5
commit 1da934e63c
7 changed files with 57 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ import {
useState,
} from "react";
import Hls from "hls.js";
import { isAndroid, isDesktop, isIOS, isMobile } from "react-device-detect";
import { isAndroid, isDesktop, isMobile } from "react-device-detect";
import { TransformComponent, TransformWrapper } from "react-zoom-pan-pinch";
import VideoControls from "./VideoControls";
import { VideoResolutionType } from "@/types/live";
@@ -33,6 +33,7 @@ type HlsVideoPlayerProps = {
visible: boolean;
currentSource: string;
hotKeys: boolean;
supportsFullscreen: boolean;
fullscreen: boolean;
onClipEnded?: () => void;
onPlayerLoaded?: () => void;
@@ -49,6 +50,7 @@ export default function HlsVideoPlayer({
visible,
currentSource,
hotKeys,
supportsFullscreen,
fullscreen,
onClipEnded,
onPlayerLoaded,
@@ -180,7 +182,7 @@ export default function HlsVideoPlayer({
seek: true,
playbackRate: true,
plusUpload: config?.plus?.enabled == true,
fullscreen: !isIOS,
fullscreen: supportsFullscreen,
}}
setControlsOpen={setControlsOpen}
setMuted={(muted) => setMuted(muted, true)}