File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1+ export const isFullscreen = ( ) => {
2+ return ! ! (
3+ document . fullscreenElement ||
4+ ( document as any ) . webkitFullscreenElement ||
5+ ( document as any ) . mozFullScreenElement ||
6+ ( document as any ) . msFullscreenElement
7+ )
8+ }
Original file line number Diff line number Diff line change 11import { useEffect } from 'react'
2+ import { isFullscreen } from '../helper/isFullscreen'
23
34export const useUpdatePlayerHeight = (
45 containerRef : React . MutableRefObject < HTMLDivElement | null > ,
56 setHeight : ( value : React . SetStateAction < number > ) => void
67) => {
78 useEffect ( ( ) => {
89 const updateHeight = ( ) => {
10+ if ( isFullscreen ( ) ) {
11+ return
12+ }
13+
914 if ( containerRef . current ) {
1015 const width = containerRef . current . offsetWidth
1116 setHeight ( Math . round ( ( width * 9 ) / 16 ) )
You can’t perform that action at this time.
0 commit comments