How to automatically play video on ios video

We found that after adding the autoply attribute to the video, it still cannot be played automatically, because Apple and Android automatically play through the normal mechanism, we need to manually trigger the play method.

 <video controls autoplay muted loop style="width:500px;" class="video" controlslist="noplaybackrate">
        <source src="media/open.mp4">
        <source src="media/open.webm">
        <p>
            对不起,你的浏览器不支持video元素,请点击这里下载最新版本的浏览器
        </p>
    </video>
    //mounted 
        let ele = document.querySelector('.video');
        if(ele){
    
    
          ele.play();
         }  

Guess you like

Origin blog.csdn.net/qq_42931285/article/details/124336125