Fix Front Row 'movie trailer not responding' errors

Dec 22, '05 05:49:00AM

Contributed by: gboudrea

I was getting a lot of "The movie trailer server is not responding" errors when trying to watch movie trailers from Front Row. After some digging, I found out that, even though I was able to watch iTunes' "largest" trailers without problems, Front Row downloads a Quicktime file that is even bigger that the largest trailer available from iTunes Movie Trailers section.

My solution: Trick Front Row into downloading iTunes' largest trailers, which I know my internet connection can stream without problems.

What you need: a web server, accessible from the Mac running Front Row, that supports some sort of server-side scripting and virtual-hosts. I'll explain how I did it with Apache and PHP.

Side effect: You won't be able to access apple.com on the Mac running Front Row. There might ways to fix this, and I'm sure someone will comment if there is.

The actual hack:

  1. On the Mac running Front Row, start NetInfo Manager from Applications: Utilities. Click the lock in the lower left corner to enable changes. Select machines, then localhost. Click the Duplicate toolbar button.

    On the new localhost copy, change the ip_address to the IP address of your web server, and name to www.apple.com

  2. Depending on your configuration, you might need to sudo vi /etc/hosts (in Terminal) and add a line with web.server.ip.num www.apple.com. You can try to ping www.apple.com from the Terminal, and see what IP it resolves to. If it pings your web server, then continue with the next step. For example:
    127.0.0.1       localhost
    255.255.255.255 broadcasthost
    ::1             localhost
    286.287.384.999  www.apple.com
    
  3. On your web server, create a virtual host for www.apple.com. Don't forget to restart your web server for your configuration change to be effective! Example:
    <VirtualHost *:80>
        ServerName www.apple.com
        ServerAdmin you@yourdomain.com
        DocumentRoot /var/www/html/apple.com
    </VirtualHost>
  4. In your new virtual host document root (/var/www/html/apple.com in my case), use these commands to create some new directories:
    $ mkdir trailers
    $ mkdir trailers/home
    $ mkdir trailers/home/xml
    
  5. Create a PHP script in this new directory, named current.xml:
    <?php
    header("Content-Type: text/xml");
    $url = "http://www.apple.com/trailers/home/xml/current.xml";
    $fp = fopen($url,'r'); if (!$fp) die("Can't open $url");
    while (!feof($fp)) {
      $line = fgets($fp);
      echo str_replace('_v640.mov','_h320.mov',$line);
    }
    fclose($fp);
    ?>
    
  6. In that same directory, create a .htaccess file to tell Apache to run .xml files as PHP files:
    AddType application/x-httpd-php .xml
    
  7. From the Mac running Front Row, test your work by loading this URL in your browser. You should see a lot of text, and links to .mov files that end with _h320.mov.
You're done. Fire Front Row and enjoy your new Movie Trailers!

Explanation of what you did: You told your Mac that www.apple.com is actually on your web server (steps 1 and 2). You made your web server accept requests for www.apple.com (3). You created a script that fetches the real current.xml file from www.apple.com, replaces the .mov URL in it, and returns the result (4 and 5).

Front Row will now be fooled into downloading your customized file, which contains URLs to smaller trailers.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2005121715494143