Embedding QuickTime in HTML
Every once in a while, a developer new to QuickTime will post to one of the developer lists, saying he needs QTJ to put a QuickTime movie in a web page.
QTJ is great, but this is way, way overkill. For this task, you don’t need QTJ. In fact, you’d just be creating headaches for yourself by requiring QTJ and dealing with the hassles of applets. Instead, you can just embed QuickTime content in HTML.
Note
The mailing lists at http://lists.apple.com/ are a great source of information, particularly quicktime-java, quicktime-users (authoring), and quicktime-api (native programming). java-dev is also helpful for figuring out issues with Mac OS X’s Java implementation.
How do I do that?
In your HTML page, use an
<object>
tag, which wraps an
<embed>, as shown in Example 1-1.
Example 1-1. Embedding QuickTime in HTML
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="160" height="136" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" VALUE="buhbuhbuh.mov"/> <param name="autoplay" VALUE="true"/> <param name="loop" VALUE="true"/> <param name="controller" value="true"/> <embed src="buhbuhbuh.mov" width="160" height="136" scale="tofit" controller="true" autoplay="true" loop="true" pluginspage="http://www.apple.com/quicktime/download/"/> </object>
The parameters are generally self-explanatory:
height, width, and
src are the only ones that are actually required.
Because I’ve chosen to include a controller widget,
I add 16 to the height ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access