This is the video code that is displayed on the computer, and on the Nexus 5 phone, no

<video preload="auto" autoplay="autoplay" muted="muted" loop="loop" webkit-playsinline="" style="max-width: 100%; width: 100%; max-height: 480px;"> <source src="http://i.imgur.com/YhTmK3s.mp4" type="video/mp4"> <source src="http://i.imgur.com/YhTmK3s.webm" type="video/webm"> </video> 

An example on the site

  • perhaps the problem is in redirecting video addresses, i.e. i.imgur.com/YhTmK3s.mp4 redirects people to i.imgur.com/YhTmK3s.gifv . And if you execute the code here from a computer and copy the video address, it will be .mp4 A for mobile phones (possibly) and if you go to the address yourself, it will transfer to .gifv. - Dima123

1 answer 1

Most likely this is due to the fact that in mobile browsers a slightly different security policy, which, in particular, prohibits the autoloading of the video. Playback is possible only after a user clicks on the player (you can get around to the android, ios video policy is not yet possible in ios ). Try:

 var video = document.getElementById('player'); video.addEventListener('click',function(){ video.play(); },false); 
 <video id="player" autobuffer> <source src="http://i.imgur.com/YhTmK3s.mp4" type="video/mp4"> <source src="http://i.imgur.com/YhTmK3s.webm" type="video/webm"> </video> 

  • It did not help, maybe the problem is in the redirect of the video addresses, i.e. i.imgur.com/YhTmK3s.mp4 redirects people to i.imgur.com/YhTmK3s.gifv . And if you execute the code here from a computer and copy the video address, it will be .mp4 A for mobile phones and if you go to the address yourself, it will transfer to .gifv. - Dima123
  • and how OK implemented it? only the video gets into focus or in the center of the screen as it starts playing without any clicks on it! ? - user33274
  • There are a couple of hacks when you can simulate a user click on the video. This is described here , and there is a plugin. But, this does not work in all Ios. - Mikl