Using Javascript to embed QuickTime


Next
Apple has provided a JavaScript Library for embedding QuickTime content. The library can be downloaded by clicking here. The library should be available on your web server and referenced by any page with embedded QuickTime content. It simplifies inline QuickTime content - it is no longer necessary to enter parameters for both the OBJECT and EMBED tags (the Library handles that task for you). The basic syntax for calling the JavaScript Library is:

<script language="JavaScript"
type="text/javascript">
QT_WriteOBJECT('Movie URL',
'Movie Width','Movie Height','ActiveX Version',
'First Attribute Name','First Attribute Value',
'Next Attribute Name','Next Attribute Value',
...repeat attributes as necessary
'Last Attribute Name','Last Attribute Value' );
</script>

Notes

  1. You must include the AC_QuickTime.js library in your page before you call it on your page. A good place to include the library is the next line after your page's <body> tag. The syntax for including the external library is
    <script src="path to library/AC_QuickTime.js"
    language="JavaScript" type="text/javascript">
    </script>
  2. The classid of the ActiveX control is set by specifying a value for ActiveX Version. You can use the default value by using '' for this paramter.
  3. If you pages are XHTML compliant, you can call the function QT_WriteOBJECT_XHTML instead of QT_WriteOBJECT.
  4. By default the movie controller is displayed. You need to add 16 to the height to accomodate the controller.
  5. By default the movie plays as soon as it can automatically (fast start movies)