I've got a problem controlling a quicktime movie from javascript. I am embedding a video in my HTML page using <video>
HTML5 element - with fallback to quicktime if the browser doesn't support it (e.g. IE 8) (I have a specific requirement of "no flash", but quicktime is allowed). The video is displayed in a popup; when the popup is being closed, I want to stop video playback. I can do this successfully in HTML5, but the quicktime control is not working.
My html looks like this:
<video width="360" height="298" autobuffer="autobuffer" controls="controls" id="video" tabindex="0">
<source type="video/mp4; codecs="avc1.42E01E, mp4a.40.2"" src="/data/mmg-demo.mp4"></source>
<source type="video/ogg" src="/data/mmg-demo.ogv"></source>
<object width="360" height="298" id="videoem" codebase="http://www.apple.com/qtactivex/qtplugin.cab" classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b">
<param value="/data/mmg-demo.mp4" name="src">
<param value="false" name="autoplay">
<param value="true" name="controller">
<embed width="360" height="298" name="videoem" pluginspage="http://www.apple.com/quicktime/download/" loop="false" controller="true" autoplay="false" src="../files/380/380523/video.mp4">
</object>
</video>
The pop-up close javascript function looks like this:
function closePopup {
//stop html5 playback if it's there
if(typeof document.getElementById('video').pause == 'function') {
document.getElementById('video').pause();
}
//stop playback of quicktime embed if it's there
if(document.getElementById('videoem')) {
document.getElementById('videoem').SetRate(0.0);
}
$('#demo-video').fadeOut();
}
I've tested this exact same quicktime code in firefox - and it works fine. Moreover, examples in other forums that claim to work, do not work in IE 8 (e.g. see http://lists.apple.com/archives/quicktime-api/2008/Mar/msg00187.html - does not work in IE 8).
Line document.getElementById('videoem').SetRate(0.0)
causes Object does not support this property or method
error.
I'm not sure where else to look. Any help is greatly appreciated.