Yes. You need to check the file type of the source (or preview) image and change the HTML display code accordingly. In a cross-platform environment (the Web!) you should apply windows style 3-letter extensions to all your files so the easiest check method is to look at the value returned by %Extension Win% and check (case insensitively) for "MOV". If you are using QuickTime static images with a "MOV" extension further planning will be needed.
A quick example (assumes you have QuickTime installed) is here.
The solution below expands on this using Extensis supplied templates and scripts. Kudos to Victor Velt and his colleagues for the code:
===== Preview Template, in the Item where there is this script =====
<script>
<!--
document.write("<img src=\"" + makeNewPath(document.pathForm.thePath,
"wwwroot","") + "\">");
//-->
</script>
=====
Note that "wwwroot" is your root web directory.
===== Preview Template, replace it with this script =====
<script>
<!--
if
((document.pathForm.thePath.value.substr(document.pathForm.thePath.value.length-3,3))=="mov") {
document.write("<object
classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='320'
height='256' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");
document.write("<param name='SRC' value=\"" +
makeNewPath(document.pathForm.thePath, "wwwroot","") + "\">\n");
document.write("<param name='CONTROLLER' value='TRUE'>\n");
document.write("<param name='AUTOPLAY' value='TRUE'>\n");
document.write("<embed src=\"" + makeNewPath(document.pathForm.thePath,
"wwwroot","") + "\" width='320' height='256' controller='TRUE'
autoplay='TRUE' type='video/quicktime' pluginspage='http://www.apple.com/quicktime/download/'>","</embed></object>");
}
else {
document.write("<img src=\"" + makeNewPath(document.pathForm.thePath,
"wwwroot","") + "\">");
}
//-->
</script>
If you wish to add a link to the movie, don't try wrapping the <object> with a hyperlink or use the 'onClick' event - both will fail on some or all browsers. Use the 'href' attribute in the <embed> tag and as a named 'param' in the <object> tag.
Note that the controller bar (VCR-type control) adds 16 pixels to the height of the movie when displayed. Put another way, you must set the Object/Embed height attribute value to the movie height plus 16 pixels if the controller bar is going to be shown on-screen.
To investigate further the embedding of QuickTime in web pages, see these Apple pages: embedding QuickTime, QuickTime attributes.
Question: Can I play QuickTime movies as previews? [FAQ00218.htm]
Last Update:- 31 May 2006
Site and articles © Mark Anderson 2001-2007 - Visit my home page