This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
} from '@/components/audio/AudioPlayer.vue'
|
||||
import {
|
||||
audioPlayInfoRepository,
|
||||
audioReasonToText,
|
||||
type AudioLanguage
|
||||
} from '@/repositories/AudioPlayInfoRepository'
|
||||
import type { AudioPlayTargetType } from '@/domain/museum'
|
||||
@@ -276,6 +277,10 @@ const switchLanguage = async (lang: AudioLanguage) => {
|
||||
|
||||
const preservedMode = displayMode.value
|
||||
pendingLanguage.value = lang
|
||||
stopAudioElement()
|
||||
playing.value = false
|
||||
currentTime.value = 0
|
||||
duration.value = 0
|
||||
loading.value = true
|
||||
error.value = ''
|
||||
|
||||
@@ -311,7 +316,7 @@ const switchLanguage = async (lang: AudioLanguage) => {
|
||||
loading.value = false
|
||||
currentTime.value = 0
|
||||
duration.value = 0
|
||||
error.value = '当前语言暂无语音讲解'
|
||||
error.value = audioReasonToText(playInfo.reason || 'NO_PUBLISHED_AUDIO')
|
||||
showToast(error.value)
|
||||
return false
|
||||
}
|
||||
@@ -341,7 +346,7 @@ const switchLanguage = async (lang: AudioLanguage) => {
|
||||
loading.value = false
|
||||
currentTime.value = 0
|
||||
duration.value = 0
|
||||
error.value = '当前语言暂无语音讲解'
|
||||
error.value = '语音服务暂不可用,请稍后重试'
|
||||
showToast(error.value)
|
||||
return false
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user