...

View Full Version : getting a video object's width and height



fat
12-27-2011, 03:17 PM
I have embeded a video like this:

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

I would like to retrieve the video's width and height (resolution), for example: 640x480

how can I do that via JavaScript?

this is what I tried:


var objPlayer = document.MediaPlayer1;

alert(objPlayer.offsetWidth);
alert(objPlayer.width);


alert(document.getElementById('showDis').style.width);
alert(document.getElementById('showDis').style.offsetWidth);


nothing gives me the real value.

even looked here: http://msdn.microsoft.com/en-us/library/dd563945(v=VS.85).aspx but couldn't find anything relevant



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum