diff --git a/react-native-video/videoFullScreen.tsx b/react-native-video/videoFullScreen.tsx new file mode 100644 index 00000000..531b34d2 --- /dev/null +++ b/react-native-video/videoFullScreen.tsx @@ -0,0 +1,85 @@ +import React, { useRef } from 'react'; +import { Image, View, Button, StyleSheet } from 'react-native'; +import Video from '@react-native-oh-tpl/react-native-video'; + +const App = () => { + const videoPlayer = useRef(null); + + // 切换到全屏模式 + const handleFullscreen = () => { + if (videoPlayer.current) { + console.info('切换到全屏'); + videoPlayer.current.presentFullscreenPlayer(); + } + }; + + // 退出全屏模式 + const handleExitFullscreen = () => { + if (videoPlayer.current) { + videoPlayer.current.dismissFullscreenPlayer(); + // setIsFullscreen(false); // 退出全屏 + } + }; + + + + return ( + + console.log('Image loaded!')} // 图片加载完成时触发 + /> + + {/* 视频组件 */} +