I’m using iPhone OS 3.x on my iPhone and recently i had problems to get my .mp4 files displayed in mobile Safari. I tried different settings for encoding the files but not a single one worked. When i clicked the link to the .mp4 file in mobile Safari, all i got was the “file can’t get downloaded” error. After some googling i found a clue that it might has something to do with MIME types and the apache server hosting the videos.
Solution:
- encode your videos for iPhone / iPod Touch (Compressor, Quicktime, Adobe Media Encoder, …)
- test them on the device (add the video to your iTunes library and upload it to your iPhone and watch it!)
- upload the video to your webserver
- make sure you have the following line in your apache config or in a .htaccess file in your directory on your webserver:
1 | AddType video/mp4 mp4 mp4v mpg4 m4v |
That’s it, now progressively watching .mp4 videos from your webserver on your iPhone should work (again).