From 9a26c1543942acc21164f66b41dc61187aa3fabc Mon Sep 17 00:00:00 2001 From: fan-kuiwei Date: Mon, 17 Mar 2025 18:48:27 +0800 Subject: [PATCH] =?UTF-8?q?test:=20react-native-video=20=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-native-video/videoFullScreen.tsx | 85 ++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 react-native-video/videoFullScreen.tsx 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!')} // 图片加载完成时触发 + /> + + {/* 视频组件 */} +