Commit 784487f3 authored by ali's avatar ali

fix: 修复视频播放完没有停止问题

parent 93479e9e
...@@ -371,13 +371,14 @@ async function runAudioPlay() { ...@@ -371,13 +371,14 @@ async function runAudioPlay() {
isPlayRunning = true isPlayRunning = true
const audio = ttsAudios.shift() const audio = ttsAudios.shift()
const videoEle = videoElement.value as HTMLVideoElement;
if (!audio) { if (!audio) {
isPlayRunning = false isPlayRunning = false;
videoEle.pause();
return return
} }
audio.onended = () => { audio.onended = () => {
isPlayRunning = false isPlayRunning = false
const videoEle = videoElement.value as HTMLVideoElement
videoEle && (videoEle.loop = true) videoEle && (videoEle.loop = true)
videoEle && (videoEle.muted = true) videoEle && (videoEle.muted = true)
setVideoUrl(new URL('/libai/10.mp4', import.meta.url).href) setVideoUrl(new URL('/libai/10.mp4', import.meta.url).href)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment