html5 video not working on ipad

后端 未结 4 1204
暗喜
暗喜 2020-11-29 05:30

I have an html5 video that should work on ipad. Controls must be hide and on user tap on the ipad, the html5 video must play.

I am using html5video.js What I can se

4条回答
  •  囚心锁ツ
    2020-11-29 06:12

    Try this trick (void user to tap screen):

    document.addEventListener('touchstart', function(event) {
    
      video.play();
    
      // They use this first touch/click event for buffering others video.
      // with this trick 
    
      video2.play();
      video2.pause();
    
      // After in your program you can call from 'code' play video.
      // Sum of success buffering per one click is 3 ~ 6 ( android or ios ).
    
    
    }, false);
    

    For me works on android tablet samsung , iphone and ipad 2/3.

    Updated :

    With new version of browsers also autoplay is enabled by default, you need to put attribute mute for success.

    There is no final solution. For example firefox version 64 on mac don't support but same version on linux support autoplay. And so long...

提交回复
热议问题