Sample video showing the problem: https://gget.it/io64/h264test13576.mp4 – can you play it on Safari?
I have a video on a HTML page
<video controls><source src="/files/test.mp4"></video>
that works on PC (Firefox, Chrome, etc.) but sadly it doesn’t work on iPhone Safari (which I don’t have handy, so difficult to debug): instead of the video there is a grey background.
What common reasons prevent a MP4 video to be played on Safari for iPhone?
Note: I’ve tried various things like:
-
controls
=>controls="true"
as explained in HTML5 Video tag not working in Safari , iPhone and iPad (not a duplicate) -
adding
playsinline
-
changing from
<video ...><source src="..."></video>
to<video ... src="...">
but the problem still exists.
2
Answers
Additional information: the answer mp4 H264 video won't play in iPhone safari gives a hint about the reasons why Safari won't play this video:
Safari (also desktop) doesn’t like the
moov
atom not being at the start of the file.This fixes it: