Embed Video Without Flash into PHP Web Page for Viewing in iPod Touch


The iPod Touch does not play embedded Flash videos from YouTube.com on web pages.   Redirect the visitor to an alternate page containing a QuickTime video.

System Requirements

  • A web page ending in .php
  • A QuickTime video file ending in .mov
  • An iPod Touch (for testing purposes)


  1. Use the PHP version of the redirect code in an article by David Walsh, “iPhone & iPod Detection Using JavaScript“.  Insert the code into the top of the originating (.php) web page, from which, the redirection should occur:
    if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||
     header('Location: http://your-website.com/alternate-page.php');
  2. Use the object code from the Apple developer site, “Instructions for Updating Websites to Include QuickTime Content“.  Insert the code into a separate page; for example, alternate-page.php:
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
    width="320" height="256" align="middle">
    <param name="src" value="sample.mov" />
    <param name="autoplay" value="true" />
  3. Adjust the parameters in the object.  The video can be in QuickTime movie format (.mov), but not (.mp4)
  4. Open the originating web page in an iPod Touch mobile device.  The browser will redirect to the ‘alternate-page‘ and the embedded video can be played.

Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: