Since iPhone 3.0, Safari won't play m4v files

Hi all,

I have published various iPhone-ready video files online. They are all encoded in the MP4 container with the h.264 codec and AAC-LC sound. Until now I could just create these files, rename the .mp4 extension to .m4v and upload these files. Then when I enter the url of the .m4v file in mobile safari, or click on a simple a href link to that .m4v file, it would play on the iPhone as a progressive download.

Since i've updated my iPhone to the latest 3.0 firmware, these movie files won't play no more. When I click on al link to the m4v file, it says: "Download failed, Safari can't download this file" (that's my own translation of the Dutch: Downloaden mislukt, Safari kan dit bestand niet downloaden)

On another site of a professional dutch newspaper: http://m.vk.nl, the files are also not working anymore, but on another site like veoh.com the video's do play from safari.

Could it be that I have to use some kind of embed code, or could the video codec/container be the problem?

An example of one my files that is now not working anymore:
http://www.xs4all.nl/~menzil/casper/afstuderen/UC_iphone.m4v

I hope to get this problem solved soon, thanks for your help!

iPhone, iPhone OS 3.0

Posted on Jun 19, 2009 3:35 AM

Reply
16 replies

Jun 20, 2009 5:13 AM in response to Casper Meijer

Casper Meijer wrote:
I basically *****. I am in the middle of graduating at the moment and was boasting that my portfolio website was 100% iPhone proof, and now the video's don't work no more.

But has anyone an idea of how it comes that the video's from google video and veoh.com can be viewed from safari?


I tried it out with Veoh, and yes, it works on my OS 3.0 phone. Strange thing is, that the videos on Veoh appear to be mp4. As far as i know Safari on iPhone 2.1 could not deal with that, i always had to convert/rename to m4v.

I'm not the programmer sort of guy, but can it be that it has something to do with the MIME type? I remember there is a way of manipulating that MIME type with a script language such as PHP in a way that the browser would handle the transfered file though http in a certain way. I can imagine that veoh is doing such a thing when renaming their videos to m4v on the fly.

I'm just guessing... time for the nerds amongst us!

Does somebody know a iphone Dev forum where we people just waiting to solve such problems? I would post that issue there if i knew.

Thanks

Jeremias

Jun 21, 2009 1:16 PM in response to Casper Meijer

Well i've been looking around at developer.apple.com and I found out that you can embed video on your website using the <video> code, it works on your iphone also. So you can't just (email someone the) link to a .m4v file but you can embed it at a simple website. The video won't start automatically but you will see a play button.

The code is something like this: <video src="yourvideosourcehere.m4v" poster="theimageyouwanttodisplayintheplayerwhilenotplaying.jpg">

Still haven't figured out how sites like google video and veoh do it, but we're getting somewhere

Jun 22, 2009 9:57 AM in response to Casper Meijer

Casper Meijer wrote:
Well i've been looking around at developer.apple.com and I found out that you can embed video on your website using the <video> code, it works on your iphone also. So you can't just (email someone the) link to a .m4v file but you can embed it at a simple website. The video won't start automatically but you will see a play button.

The code is something like this: <video src="yourvideosourcehere.m4v" poster="theimageyouwanttodisplayintheplayerwhilenotplaying.jpg">

Still haven't figured out how sites like google video and veoh do it, but we're getting somewhere


Cool, thanks Casper!

your code is working fine... Well, i'd rather like to have a link which i could open directly, but hey, it works for now.

I'm also wondering how to change MIME settings on the server. Or is there a way to manipulate them on the fly?

It seems that mobile safari is expecting a certain type of data or file type. There must be a way of tricking it to accept our mp4 or m4v data. It's not the File extension obviously, so it seems to be the type of data which has to be flagged as a acceptable video file.

What is that funny <video> tag anyway? It's not regular HTML expression, is it?

Let's get it on, i'll keep you in the loop.

Cheers Jeremias

Jun 23, 2009 5:49 AM in response to AngeloPappas

AngeloPappas wrote:
Is there a way to fix this without changing the webserver settings? I developed an app for a client with a huge collection of videos all in the m4v format. They use a 3rd party to host all the videos and we have no control over the mime setting on the server. Do I seriously have to have the client convert every file and update all the links!?


Good news everyone!

After some heavy research regarding mime settings i found out that there is a way of changing/editing MIME settings without having to edit server configuration files directly: normally you should be able to do it by simply uploading a ".htaccess" (the name of the file should be exact like this) file to the ftp root directory with the line:

....................................

AddType video/mp4 mp4 mp4v mpg4 m4v

....................................

Any Apache Server should now add that certain MIME type to it's internal list.

Then try to open your movie.m4v in your mobile safari on IPhone OS 3.0 and enjoy (hopefully).

Please keep in mind that you cannot upload the .htaccess file with binary mode, it always has to be a ASCII transfer type. You can change the transfer type within your FTP program accordingly. In some cases the OS is hiding files with a dot "." in the beginning by default (especially on Mac OS), but there are workarounds.

The only restriction is that the movie filetype should always be m4v since mobile safari still seems to dislike native mp4's. Well, on the contrary veoh delivers mp4's an we can open them with OS 3.0 mobile safari. Maybe they did the encoding in native m4v containers and renamed them afterwards, i don't know.

If there is a way of opening m4v as well as mp4 with mobile safari, please let me know, i'll keep on trying, too

I'm exited if my solution is working for you,

cheers Jeremias

Jun 23, 2009 9:23 AM in response to kingkong36

After some heavy research regarding mime settings i found out that there is a way of changing/editing MIME settings without having to edit server configuration files directly: normally you should be able to do it by simply uploading a ".htaccess" (the name of the file should be exact like this) file to the ftp root directory with the line:

....................................

AddType video/mp4 mp4 mp4v mpg4 m4v

....................................


Can anyone confirm if this works?

Jun 23, 2009 9:45 AM in response to JasonInSD

JasonInSD wrote:
After some heavy research regarding mime settings i found out that there is a way of changing/editing MIME settings without having to edit server configuration files directly: normally you should be able to do it by simply uploading a ".htaccess" (the name of the file should be exact like this) file to the ftp root directory with the line:

....................................

AddType video/mp4 mp4 mp4v mpg4 m4v

....................................


Can anyone confirm if this works?


Well, yes i can! 🙂

Honestly, it should work on any Apache server, since they all understand htaccess configuration files as far as i understood. Here comes a bunch of links which helped me finding out:

http://groups.google.com/group/iphonewebdev/msg/fce6c93497260011
http://www.javascriptkit.com/howto/htaccess.shtml
http://www.besthostratings.com/articles/mime-types-htaccess.html
http://httpd.apache.org/docs/2.2/howto/htaccess.html

I hope that helps!

regards

Jeremias

Jun 26, 2009 5:21 PM in response to kingkong36

I don't know if many of you are aware that there are many different type of mp4 and m4v files. Have you ever tried to figure out why some mp4 or m4v files play on our iPhones while others don't. Well the answer is because when that mp4 or m4v was created or converted to that format, it wasn't created as an h.264. The h.264 mp4 and m4v is what is recognized now by OS 3.0 where as on previous firmwares the Safari browser accept more of a broad range of mp4 or m4v format types. h.264 is the key and is growing very popular with Youtube videos and Google Videos as well. Try adding an h.264 type mp4 file to your site and I assure you it will stream.

iFortner

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Since iPhone 3.0, Safari won't play m4v files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.