...

View Full Version : displaying current position not working in firefox with WM plugin



fat
06-23-2009, 01:15 PM
Hi guys

I have a piece of code that works with IE7 and IE8 but don't work with firefox with the windows media plugin installed.

I'm trying to "alert" the current position (timeline) of a video.

html code:


<div class='videoDiv' id='showDis'>
<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' ID='MediaPlayer1'>
<param name='url' value='myvideo.asx' />
<param name='src' value='myvideo.asx' />
<param name='showcontrols' value='true' />
<param name='autostart' value='true' />
<!--[if !IE]>-->
<object type='video/x-ms-wmv' data='myvideo.asx' height='400' width='450'>
<param name='src' value='myvideo.asx' />
<param name='autostart' value='true' />
<param name='controller' value='true' />
</object>
<!--<![endif]-->
</object>
</div>

<input type=button onclick="showCurrentPosition();" value="Show Timeline Position">



javascript code:

function showCurrentPosition(){
objPlayer = document.getElementById('MediaPlayer1');
alert(objPlayer.controls.currentPosition);
}


I get the following error:


Error: objPlayer.controls is undefined


here (http://msdn.microsoft.com/en-us/library/dd564570(VS.85).aspx) it says the "controls" object is suppose to work in firefox
what am I doing wrong in the javascript or html code ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum