Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    fat
    fat is offline
    New Coder
    Join Date
    Jun 2009
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    getting a video object's width and height

    Hi

    I have embeded a video like this:
    Code:
    <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:
    Code:
    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/libr...(v=VS.85).aspx but couldn't find anything relevant

  • #2
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    329
    Thanks
    9
    Thanked 49 Times in 48 Posts
    How about using IE's built-in Developer Tools (F12) to check the real values?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •