Is there a possibility to play a MP4 video on iPad? I created a website for a client, with a teaser video on the front-page. I have done this with the HTML5 tag video
, like so:
<video autoplay loop muted>
<source src="video/teasermauricedraait.webm" type="video/webm">
<source src="video/teasermauricedraait.mp4" type="video/mp4">
</video>
Above code is working as aspect on desktop, but on tablet (iPad) and mobile (iPhone) the video isn't displayed.
Tried also to add another line of source code, but this doesn't fix the issue:
<source src="video/teasermauricedraait.mov" type="video/mov">
What does I do wrong?
MP4 is a 'container' specification for video and audio steams and the videos and audios in the container may use different encodings.
The subset that is supported on an iPAD is definined here: - https://developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/MediaLayer/MediaLayer.html
the relevant extract is:
Your case is slightly more complicated in that the video is in a browser on the device - you may not want this automatically to play on a Mobile device as with some price plans you may be running up data costs for your users - this is a key reason auto play of videos on mobile devices is not historically supported. There are various workaround people have tried but I'm not sure there is one that works universally, and you really need to think about whether you actually want to do this.
If the video will not play at all, even when the user clicks play then a common problem which can cause a video to play fine in a browser but not on an iOS device (especially older ones) is the profile of the h.264 video - you can see above that 'baseline' is supported.
This can be checked with tools like ffprobe (https://www.ffmpeg.org/ffprobe.html) if you are familiar with it. If not and you are able to post a link to your video in the comments here others can check for you.