添加触发切换默认的条件
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m53s

This commit is contained in:
Song367 2025-08-12 16:09:31 +08:00
parent 6e7ab83091
commit 9ef75a1745

View File

@ -88,13 +88,16 @@ async function processAudioQueue() {
isProcessingQueue = false; isProcessingQueue = false;
// 等待当前音频播放完成后再切换回默认视频 // 等待当前音频播放完成后再切换回默认视频
while (isPlaying) { // while (isPlaying) {
await new Promise(resolve => setTimeout(resolve, 100)); // console.log("触发音频等待")
} // await new Promise(resolve => setTimeout(resolve, 1000));
// }
// console.log("触发音频等待")
// await new Promise(resolve => setTimeout(resolve, 300));
const text = 'default' const text = 'default'
console.log("音频结束------------------------", window.webrtcApp.currentVideoTag, isPlaying) console.log("音频结束------------------------", window.webrtcApp.currentVideoTag, isPlaying)
if (window.webrtcApp.currentVideoTag != text) { if (window.webrtcApp.currentVideoTag != text && !isPlaying) {
isFirstChunk = true isFirstChunk = true
window.webrtcApp.currentVideoTag = text window.webrtcApp.currentVideoTag = text
window.webrtcApp.switchVideoStream(window.webrtcApp.defaultVideo, 'audio', text); window.webrtcApp.switchVideoStream(window.webrtcApp.defaultVideo, 'audio', text);