Uc browser cannot trigger the play method of audio

  1. during the development of the player, the real machine debugging found that the uc browser could not trigger the play event of the audio tag, nor could it play it automatically.
  2. Test code
<template>
    <div class="audio-wrapper" ref="audioWrapper" @touchstart.stop="audioPlay">
        <audio @touchstart.stop @play="playing"
               src="//dl.stream.qqmusic.qq.com/C400000fcbn33tw0lQ.m4a?vkey=2287E4C8B54E21B92310DD2BE8218EF9FFDBAA41889FC74A90C23350F387C462F09AD6B9AEB411E2C7E8CBB8E5498BE09F0AB24D4A039FEB&guid=4339008184&uin=0&fromtag=66"
               ref="audio" controls ></audio>
    </div>
</template>

<script>
  export default {
    methods: {
      audioPlay () {
        console.log(this.$refs.audio)
        console.log(this.$refs.audio.play)
        this.$refs.audio.play()
      },
      playing () {
        console.log("playing")
      }
    }
  }

</script>
<style scoped lang="stylus" rel="stylesheet/stylus">
    .audio-wrapper
        position: fixed
        width: 100%
        height: 100%
        background-color: rgba(0, 0, 0, 0.6)

</style>

3. Test results
after the touchstart event is triggered in the uc browser, the audio tag dom and the play () method are printed, but the console in the ready method called by the play event d of the audio tag is not executed and the song is not played

clipboard.png

qqtouchstart audiodom , play() , pinging
clipboard.png

the bosses who answered looked up and bowed their heads to pick up the money!


https://zhuanlan.zhihu.com/p/.
find a way to workaround


I also encountered, depressed
can not automatically play all right, tmd can not even call play () to play


automatic playback has been banned. Prevent illegal use of


encounters. It doesn't work on ios or android, but you can click on the audio tab.

Menu