HTML 5 Video “autoplay” not automatically starting in CHROME

后端 未结 9 523
死守一世寂寞
死守一世寂寞 2020-11-30 02:51

I have the following code:

9条回答
  •  醉酒成梦
    2020-11-30 03:36

    Try this when i tried giving muted , check this demo in codpen

        
    

    script

    function toggleMute() {
    
      var video=document.getElementById("videoId");
    
      if(video.muted){
        video.muted = false;
      } else {
        debugger;
        video.muted = true;
        video.play()
      }
    
    }
    
    $(document).ready(function(){
      setTimeout(toggleMute,3000);
    })
    

    edited attribute content

    autoplay muted playsinline
    

    https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

提交回复
热议问题