|
@@ -756,7 +756,11 @@ export default {
|
|
|
that.audioPlayer.muted = that.ariaSettings.isMuted
|
|
|
that.audioPlayer.playbackRate = speechRateFactors[that.ariaSettings.speechRateLevel]
|
|
|
that.audioPlayer.oncanplaythrough = () => {
|
|
|
- that.audioPlayer.play()
|
|
|
+ if (document.visibilityState === 'visible') {
|
|
|
+ that.audioPlayer.play()
|
|
|
+ } else {
|
|
|
+ that.$emit('audio-abort', taskId)
|
|
|
+ }
|
|
|
}
|
|
|
that.audioPlayer.onended = () => {
|
|
|
that.$emit('audio-end', taskId)
|
|
@@ -956,7 +960,7 @@ export default {
|
|
|
})
|
|
|
this.$once('audio-abort', (taskId) => {
|
|
|
if (taskId === continueReadTaskId) {
|
|
|
- resolve()
|
|
|
+ reject('audio-abort')
|
|
|
}
|
|
|
})
|
|
|
})
|