chore: add setFullScreen to component's ref (#3855)
* chore: add setFullScreen to component's ref and remove presentFullscreenPlayer & dismissFullscreenPlayer
This commit is contained in:
committed by
GitHub
parent
016fca8a2a
commit
3a4a13011a
@@ -66,6 +66,7 @@ export interface VideoRef {
|
||||
save: (options: object) => Promise<VideoSaveData>;
|
||||
setVolume: (volume: number) => void;
|
||||
getCurrentPosition: () => Promise<number>;
|
||||
setFullScreen: (fullScreen: boolean) => void;
|
||||
}
|
||||
|
||||
const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
@@ -300,6 +301,10 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
return VideoManager.getCurrentPosition(getReactTag(nativeRef));
|
||||
}, []);
|
||||
|
||||
const setFullScreen = useCallback((fullScreen: boolean) => {
|
||||
return VideoManager.setFullScreen(fullScreen, getReactTag(nativeRef));
|
||||
}, []);
|
||||
|
||||
const onVideoLoadStart = useCallback(
|
||||
(e: NativeSyntheticEvent<OnLoadStartData>) => {
|
||||
hasPoster && setShowPoster(true);
|
||||
@@ -518,6 +523,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
restoreUserInterfaceForPictureInPictureStopCompleted,
|
||||
setVolume,
|
||||
getCurrentPosition,
|
||||
setFullScreen,
|
||||
}),
|
||||
[
|
||||
seek,
|
||||
@@ -529,6 +535,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
|
||||
restoreUserInterfaceForPictureInPictureStopCompleted,
|
||||
setVolume,
|
||||
getCurrentPosition,
|
||||
setFullScreen,
|
||||
],
|
||||
);
|
||||
|
||||
|
@@ -391,6 +391,7 @@ export interface VideoManagerType {
|
||||
) => Promise<void>;
|
||||
setVolume: (volume: number, reactTag: number) => Promise<void>;
|
||||
getCurrentPosition: (reactTag: number) => Promise<number>;
|
||||
setFullScreen: (fullScreen: boolean, reactTag: number) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface VideoDecoderPropertiesType {
|
||||
|
Reference in New Issue
Block a user