views:

257

answers:

4

Is there any movie that actually works in iPhone/iPad safari using the video tag? We tried so many formats and code snippets. I've heard that mp4/h264 should work, but not for us.

Can anyone point me to a working example online?

If you know the code or specs/formats for the videotag on iphone, that would be great.

Update:

Here is a link to the mp4 file we have: http://aino.se/media/207.mp4 Here is the latest code we tried:

<video width="480" height="270" controls autoplay>
    <source src="http://aino.se/media/207.mp4" type="video/mp4">
</video>

Works great in Safari/Chrome but no show in iPhone/iPod

A: 

Apple has a list of sites that use HTML5 to work properly with iPad: http://www.apple.com/ipad/ready-for-ipad/

HTML5's video tag with a h264 source should work just fine.

ceejayoz
"should" is what I heard, but we tried all the video tag examples we found. It works fine in webkit/safari on the mac but not on the iPhone.
David
Can you link to some of these examples?
ceejayoz
Updated with links and example. Thanks!
David
A: 

The video tag works on the iPad and iOS4, not iPhone OS 3.1 and earlier.

Matt David
This is incorrect. The video tag works on both the iPad and on iPhone since version 3.0 was released. Visit Vimeo.com on your phone for actual, working examples.
Andrew
Hmmm — just tried Vimeo on my iPhone, and it seems to make video play via the iPhone’s QuickTime app rather than via HTML5 video. Have you got a URL for a Vimeo video that does use the HTML5 video tag on the iPhone?
Paul D. Waite
All HTML5 video on iPad/iPhone initializes the Quicktime player. It's not feasible to have the video play directly on the page.
Andrew
+1  A: 

The fact that the videos are working on desktop versions of Chrome and Safari suggest that the problem is how your videos are encoded. While the iPhone and iPad support H.264 video via HTML5, they only support the most baseline profile available. This means that extra things you can do to make the video look better (like extra Reference Frames, B-Frames, CABAC, etc) all render the video unplayable on iOS.

What encoding software are you using? I would try encoding the videos again with the most vanilla settings available: set an average bit rate, keep the FPS the same, and maybe do a two-pass if you think it'll help with quality. Everything beyond that is pretty shaky ground.

Edit: As for examples, vimeo.com has all of their videos in an iPhone-ready format.

Andrew
My iPod cant play any of the viedeos at vimeo.com. It also seems that the video tag is not used at all, the device asks if the user wants to download or play the movie in mediaplayer, so you might as well use a normal link.
David
You need to have iOS 3 (or greater) installed for it to be supported. I just visited Vimeo mobile website again to confirm and this is what I'm presented with: http://dl.dropbox.com/u/1762184/photo.png --- Further, you can read their blog about implementing the HTML5 video tag for Safari or Chrome on their site: http://vimeo.com/blog:268
Andrew
It should also be noted, as I answered in a later post, that HTML5 video on the iPhone/iPad does not play on the page, but rather initializes the Quicktime player to take up the full screen (which means that certain tags like controls, autoplay, and autobuffer are meaningless on the iPhone).
Andrew
@Andrew: the screenshot is a listing of movies, what does it look like when you actually watch a movie? Are the images simply links to the mp4 file? Also, the blog post does not mention mobile safari, so no help there.
David
You click on one of the listed movies an it invokes the fullscreen Quicktime player to view the video, then when it's finished you get referred back to the page you were viewing. HTML5 video doesn't behave on the iPhone/iPad the same way it does on a desktop browser... It takes you to separate environment to play the videos, it doesn't play them on-page.
Andrew
so it's the same behavior as using a linked screenshot to the mp4 file?
David
Yes, pretty much identical.
Andrew
+1  A: 

Yes, the video tag works. www.sup.com.tw has some (not all. The site is in Chinese though. Click the video links on the top right hand corner.)

Newer videos on this site works with IE 6/7/8 (through fall back to flash player, not tested on IE9), Firefox (had to render a separate ogv file since no h.264 support), Safari, Chrome, iPhone Safari, Android browser (the Desire model, didn't figure out the browser type).

Problem is with your encoding. Look at this page for detail instructions on how to convert:

http://diveintohtml5.org/video.html

The key I think is the profile of the h.264 conversion. Need to make sure you're converting to Baseline profile. Other profiles are not supported in iPhone.

I used the handbrakeCLI with Automator in Mac OS X to batch render.

T1000