views:

820

answers:

2

Does anyone have any experience embedding .m4v movie files into webpages for playback on the iPhone? I'm trying to create a site optimized for the iPhone, and it includes a video, but I just can't get the video to play - all I get is the grey play arrow with a line through it.

The markup I'm trying to use for embedding it is this:

<embed width="199" height="159" type="video/x-m4v" href="http://www.samplesite.com/motion/mymovie.m4v" src="http://www.samplesite.com/motion/mymovie.jpg"/&gt;
+4  A: 

<embed> is old school

use HTML5's <video>

iPhone supports it

<video width="199" height="159" src="http://www.example.com/mymovie.m4v" />
Anurag
+1  A: 

You got the gray play arrow with a line through it, it probably means that the MPMoviePlayerController class can't play the movie.
This class only supports H.264 Baseline Profile Level 3.0 video (up to 640 x 480 at 30 fps) and MPEG-4 Part 2 video (Simple Profile), and there's a possibility that your movie file doesn't match this requirement.

HTH

tomute