我写了一个M端播放音乐的组件,使用html5的audio标签

ios vue2.0使用html5中的audio标签不能播放音乐

然后我使用watch监测currentSong

ios vue2.0使用html5中的audio标签不能播放音乐

在浏览器中看到audio渲染的如下:

ios vue2.0使用html5中的audio标签不能播放音乐

单独访问渲染出来的audio中url可以播放音乐,为什么调用:this.$refs.audioRef.play()方法不能播放音乐?

回答:ios? 如果是ios的话有限制。媒体的播放操作需要放在交互事件的回调函数里才能生效。

相关文章:

  • 2021-12-05
  • 2022-01-08
  • 2021-09-08
  • 2022-12-23
  • 2021-12-28
  • 2021-12-25
  • 2021-07-21
猜你喜欢
  • 2021-07-21
  • 2022-12-23
  • 2021-12-18
  • 2021-09-19
  • 2022-12-23
  • 2021-08-17
  • 2021-12-03
相关资源
相似解决方案