页面没有交互,js不能触发播放

 

DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

 

<video id="video" muted autoplay>
<button id="unmuteButton"></button>

<script>
  unmuteButton.addEventListener('click', function() {
    video.muted = false;
  });
</script>

 

posted on 2018-11-28 17:05  鲲跃北溟  阅读(224)  评论(0编辑  收藏  举报

导航