Commit 68e6c948 authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

fix: 移动端对话播放之前静默播放音频

See merge request !168
parents 1b1322fd d97ecd47
......@@ -83,6 +83,7 @@ onMounted(async () => {
if (userStore.isLogin) {
await handleCreateDialogues()
await handleGetAutoPlayByAgentId()
await handleInitSoundPlay()
}
fullScreenLoading.value = false
return
......@@ -296,6 +297,24 @@ function handleAudioPause(isClearMessageList = false) {
footerInputRef.value?.blockMessageResponse()
}
}
// 静默播放
function handleInitSoundPlay() {
const sound = new Howl({
src: ['https://gsst-modellink-prod.gz.bcebos.com/data/20250305/1741155741444.wav'],
html5: !validBrowser(),
volume: 0,
preload: true,
onload: () => {
sound.play()
setTimeout(() => sound.stop(), 100)
},
onplay: () => {
sound.stop()
sound.unload()
},
})
}
</script>
<template>
......
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