From 2f2d47103b08dad6c5f2e6fda90330ca52a463a5 Mon Sep 17 00:00:00 2001 From: xiaoxustudio Date: Sun, 21 Jun 2026 00:12:05 +0800 Subject: [PATCH 1/2] fix: conditionally enable video skip on double click --- packages/webgal/src/Core/gameScripts/playVideo.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/webgal/src/Core/gameScripts/playVideo.tsx b/packages/webgal/src/Core/gameScripts/playVideo.tsx index 3c0c21610..de122ce6d 100644 --- a/packages/webgal/src/Core/gameScripts/playVideo.tsx +++ b/packages/webgal/src/Core/gameScripts/playVideo.tsx @@ -63,8 +63,6 @@ export const playVideo = (sentence: ISentence): IPerform => { if (VocalControl !== null) { VocalControl.currentTime = 0; VocalControl.volume = bgmVol; - // 双击可跳过视频 - WebGAL.events.fullscreenDbClick.on(skipVideo); /** * 把bgm和语音的音量设为0 */ @@ -78,6 +76,9 @@ export const playVideo = (sentence: ISentence): IPerform => { } VocalControl?.play().catch(() => {}); + if (!blockingNextFlag) { + WebGAL.events.fullscreenDbClick.on(skipVideo); + } VocalControl.onended = () => { endPerform(); From 957fdeeb1ac49a3b5e29cf9256e26e4542d8523e Mon Sep 17 00:00:00 2001 From: Mahiru Date: Sat, 4 Jul 2026 10:42:36 +0800 Subject: [PATCH 2/2] fix: handle play video errors --- packages/webgal/src/Core/gameScripts/playVideo.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/webgal/src/Core/gameScripts/playVideo.tsx b/packages/webgal/src/Core/gameScripts/playVideo.tsx index de122ce6d..bb93f1d0a 100644 --- a/packages/webgal/src/Core/gameScripts/playVideo.tsx +++ b/packages/webgal/src/Core/gameScripts/playVideo.tsx @@ -37,6 +37,7 @@ export const playVideo = (sentence: ISentence): IPerform => { ReactDOM.render(
, document.getElementById('videoContainer')); }; const endPerform = () => { + if (isOver) return; isOver = true; WebGAL.gameplay.performController.unmountPerform(performInitName); }; @@ -75,14 +76,12 @@ export const playVideo = (sentence: ISentence): IPerform => { vocalElement.volume = '0'; } - VocalControl?.play().catch(() => {}); + VocalControl.addEventListener('error', () => endPerform()); + VocalControl.addEventListener('ended', () => endPerform()); + VocalControl.play().catch(() => endPerform()); if (!blockingNextFlag) { WebGAL.events.fullscreenDbClick.on(skipVideo); } - - VocalControl.onended = () => { - endPerform(); - }; } }, 1); },