Jump to content

[Solved] How to Get the Width of the MoviePlayer Control in a Youtube Page


Zohar
 Share

Recommended Posts

Hi

 

It's supposed to be simple yet it's not working..

I need to get the Width of the Movie Player control in Youtube.

Any youtube standard page that you see a video in it..

 

I tried:

Local $PlayerControl    =$oIE.document.getElementById("movie_player")
MsgBox(0,"",$PlayerControl.width)

And for some reason, it doesn't work.

What should I fix to make it work?

 

Thank you

Zohar

Edited by Zohar
Link to comment
Share on other sites

I now succeeded getting it, with this:

MsgBox(0,"",$PlayerControl.getBoundingClientRect().top &","& $PlayerControl.getBoundingClientRect().left &@CRLF& _
                     $PlayerControl.getBoundingClientRect().bottom &","& $PlayerControl.getBoundingClientRect().right)

Anyone knows why some Web Elements work good with .width and .height, and some need .getBoundingClientRect()?

Edited by Zohar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...