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:
javascript code: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">
Code:function showCurrentPosition(){ objPlayer = document.getElementById('MediaPlayer1'); alert(objPlayer.controls.currentPosition); }
I get the following error:
here it says the "controls" object is suppose to work in firefoxCode:Error: objPlayer.controls is undefined
what am I doing wrong in the javascript or html code ?


Reply With Quote

Bookmarks