首页 新闻 会员 周边 捐助

请问audio语音怎么控制每次只能播放一条,不能多条同时播放呀。

0
[待解决问题]

<span v-else-if="msg.type==='audio'" class="msg-text msg-audio" id="msg-audio" @click="playAudio(msg.audioSrc)">
        <span v-show="page_showAudio">{{msg.showText}}</span>
        <img class="page_voice" v-show="page_voiceShow" src="http://college.m-fyd.com/assets/yunxin/res/im/voiceSpeaker.gif"/>
      </span>
playAudio (src) {
        console.log(src)
        
        if (!this.currentAudio) {
          this.currentAudio = new Audio()
          
          
          this.currentAudio.onended = () => {
            this.page_voiceShow = false    
          }
        }
        this.currentAudio.src = src        
        this.currentAudio.play()
    this.page_voiceShow = true
}
A'的主页 A' | 菜鸟二级 | 园豆:202
提问于:2018-02-24 15:53
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册