Playing QuickTime Movies
- Previous Page Object Element Description
- Next Page Object RealVideo
The <object> element can play QuickTime movies.
QuickTime format
The QuickTime format is developed by Apple. The file extension for videos stored in QuickTime format is .mov.
On the Internet, QuickTime is a widely used format, but without additional components (free), QuickTime movies cannot be played on non-Windows computers.
By using the 'object' element, it is easy to add the code to play QuickTime videos to a web page. If the QuickTime player is not installed on the user's computer, the object can be set to automatically install the QuickTime player.
Solution
This is the code to play QuickTime videos:
<object width="160" height="144" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="sample.mov"> <param name="autoplay" value="true"> <param name="controller" value="false"> <embed src="sample.mov" width="160" height="144" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/"> </embed> </object>
<object> element
The width and height attributes of the 'object' element should match the size of the video (in pixels).
The 'classid' attribute uniquely identifies the player software to be used. It must be set to "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B". This unique code identifies the ActiveX control that must be installed on the user's PC before the movie is played. If the user has not installed this ActiveX control, the browser will automatically download and install it.
The 'codebase' attribute specifies the base path, which is used to resolve relative URLs specified by the 'classid', 'data', and 'archive' attributes. If not specified, its default value is the base URL of the current document. Note: Internet Explorer uses this attribute to specify the download location of the player. This attribute must be set to "http://www.apple.com/qtactivex/qtplugin.cab". This location contains the latest version of the QuickTime player.
The src parameter points to the movie file.
If you want the movie to play automatically, set the autoplay parameter to "true".
If you do not want to display control buttons, set the controller parameter to "false".
The <embed> Element
You can add an embed element to support browsers that do not support the object element. Browsers that understand the object element will ignore the embed element. New browsers that support ActiveX controls (Internet Explorer 5, 6, 7) will use the object element, while older browsers (Netscape 4 and 5) will use the embed element.
The width and height attributes of the embed element should match the size of the movie (in pixels).
The autoplay and controller attributes of the embed element should be set to the same values as the corresponding attributes of the object element.
The pluginspage attribute defines the download path of the player and must be set to "http://www.apple.com/quicktime/download/".
- Previous Page Object Element Description
- Next Page Object RealVideo