HREF tracks

An HREF track is a special type of text track that adds interactivity to a QuickTime movie. HREF tracks contain URLs that can specify movies that replace the current movie, load another frame, or that load QuickTime Player. They can also specify JavaScript functions or Web pages that load a specific browser frame or window.

An HREF track is not meant to be displayed; it simply contains link information. The URLs in an HREF track can be interactive or automatic. An interactive URL loads when you click anywhere in the movie's display area. An automatic URL loads as a movie is playing at the exact frame specified by a text descriptor timestamp in the HREF track. With automatic URLs, you can create a narrated tour of a website, use web pages as slides in a presentation, activate a JavaScript command, or do anything else that requires loading movies or web pages in a predetermined sequence.

Adding an HREF track to your movie

Adding an HREF track to a movie is similar to adding a chapter track. Here’s how to do it:

Step 1

Type a list of URLs into a text editor, using the HREF syntax described at left. Each text sample line should end with a carriage return. If you want to deactivate the last URL, add a blank URL (an extra carriage return) at the end of the list as described above. Save as a plain text file.

HREF Syntax

The syntax for an interactive HREF track text sample is:

<URL> T<frame>

(You must click on the movie frame to link to the URL.)

The syntax for an automatic HREF track text sample is:

A<URL> T<frame>

(The A term indicates that the URL is automatic.)

In the HREF track, an example would be:

[00:01:30.15]


A<http://www.apple.com> T<myframe>

This automatically loads an HTML frame called "myframe" with the URL "http://www.apple.com" at 1 minute, 30.5 seconds into the movie.

The URL can be relative or absolute for the QuickTime Plug-in (absolute only for QuickTime Player), but note that a relative URL is relative to the movie, not to the web page that contains it. The URL can also be a name of a JavaScript function in the current HTML page; loading the URL executes the function. You can also pass parameters or actual JavaScript code this way.

 

Step 2

In QuickTime Player, choose Open File from the File menu and select the text file.

 
Text Exporter

Step 3

Choose Export... from the File menu. Set the Export pop-up to Text to Text and set the Use: pop-up to Text with Descriptors. Click on the Options... button. In the Text Export Settings dialog, choose the Show Text, Descriptors, and Time option, choose Show Time Relative to Start of Movie, and set fractions of seconds as 1/30 (the default is 1/1000). Click Save to create a text file with descriptors.

 
Tracks View

Step 4

You now need to open several windows so you can work with text, tracks, and movie controls at the same time. Open the exported text file in your word processor. Open the target movie in QuickTime Player. Your screen should look something like the picture to the left.

 

Step 5

In QuickTime Player, find the frame in the movie where you want to load the first URL. Use the frame controls to step forward or backward a frame at a time as needed. Note the correct time in the Movie Info window.

 

Step 6

In the text file, find the first URL. It has a time stamp just before it that should look something like [00:00:00.000]. Change that to the time you noted in the Movie Info window. Make sure that each URL is given a duration of at least half a second, so that it won’t be skipped if your computer gets behind during playback.

 

Step 7

Continue editing the timestamps preceding each URL, modifying them to match the timestamps of the frames when the URL is to load. Modify the last timestamp in the text file to match the duration of the movie.

 

Step 8

Open the text file in QuickTime Pro using Open File from the File menu. This creates a new movie with just a text track. Choose Select All from the Edit menu, then choose Copy from the Edit menu. Close the movie.

 

Step 9

Click on the movie that the HREF will be added to. Select All. Add to selection and scale. This adds the text track to the movie and makes sure it is exactly the right length.

 

Step 10

In the Movie Properties window, choose the new text track. Rename the track HREFTrack exactly as shown (mixed upper and lower case, no space between HREF and Track).

 

Step 11

Disable the new HREF track by unchecking the enable check box, so it doesn’t display on top of the video. It will still function as an HREF track.

 

Step 12

Save as a self-contained movie.

 
 

More on QuickTime and HREFs

Add a text sample with a blank URL (a simple carriage return) when you want to deactivate any previous URL — for example, at the end of your movie.

The optional T<frame> parameter indicates a target frame or target window in the movie. If a target is specified, the URL is loaded into the specified frame or window.

One special instance of the T<frame> parameter is T<myself>. This opens the URL directly in QuickTime Player or the QuickTime plug-in replacing the currently playing movie. The URL must point to a file type that QuickTime can handle. Use T<myself> to link a series of QuickTime movies into a single virtual movie.

Another special instance of the T<frame> parameter is T<quicktimeplayer>. This is normally used to launch a movie in the QuickTime Player application from a movie embedded in a webpage. If the currently playing movie is already in the QuickTime Player, a new window will display the URL. Again, the URL must specify a file or stream that QuickTime can play.