Sign in to follow this  
Followers 0
Zohar

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

2 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0