From 164511130eb77fe7659360c1ee10312f5de2b808 Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Fri, 11 Aug 2023 15:11:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E4=B8=8D=E8=83=BD=E9=80=80=E5=87=BA=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/video/video.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/video/video.tsx b/src/components/video/video.tsx index 3c2cc29..fd9aeaf 100644 --- a/src/components/video/video.tsx +++ b/src/components/video/video.tsx @@ -8,7 +8,6 @@ import videoEvents from "@/hooks/videoEvents"; const deviation: number = 1 const HVideo: FC = (opt: HVideoOptions) => { let video: Taro.VideoContext - const [currentTime, setCurrentTime] = useState(0) try { @@ -42,9 +41,13 @@ const HVideo: FC = (opt: HVideoOptions) => { /** 判断是否进入断点 */ opt.breakpoint.forEach(d => { if (time < d + deviation && time > d - deviation) { - video.exitFullScreen() + video?.pause() video?.seek(d - deviation) + if (process.env.TARO_ENV === 'h5') { + document?.exitFullscreen() + } + video?.exitFullScreen() // if (opt.preview) { // Taro.showModal({ @@ -107,11 +110,14 @@ const HVideo: FC = (opt: HVideoOptions) => {