iPad html5 video with NO controls?

前端 未结 5 1161
忘掉有多难
忘掉有多难 2021-01-30 11:15

This has been killing me all day, but I am not sure how to get a html5 video player working without the native controls.

I want no controls what-so-ever but if I don\'t

5条回答
  •  北海茫月
    2021-01-30 12:13

    The best I can do is play the video as soon as the user touches the screen to do anything, even scroll down the page.

    function playVideoNow(e)
    {
        document.getElementById('video').play();
        document.removeEventListener('touchstart', playVideoNow);
    }
    
    document.addEventListener('touchstart', playVideoNow, false);
    

提交回复
热议问题