Sign in to follow this  
Followers 0
Scorputer

How do I use the IE calls to manipulate a YouTube video?

6 posts in this topic

Hi,

I'm trying to use AutoIT to navigate to Youtube.com, open a YouTube video, pause it, make it full screen, then play it. Can someone point me in the right direction as to how I can address the video window? I see things in the AutoIT help file for form objects, but I'm not sure they apply.

Gratefully yours,

- Scorputer

Share this post


Link to post
Share on other sites



The youtube player is a flash object. You'd have to use MouseClicks to do the manipulation of the actual player or use Send() for the shortcut keys. Space Pauses/Plays the video when it has the focus. Opening the page is easy just use the _IE* functions.

Share this post


Link to post
Share on other sites

The youtube player is a flash object. You'd have to use MouseClicks to do the manipulation of the actual player or use Send() for the shortcut keys. Space Pauses/Plays the video when it has the focus. Opening the page is easy just use the _IE* functions.

Thanks for the reply! So, I don't suppose there's a more elegant way of addressing the play button or full screen button as controls? Or is it maybe possible to address the Flash player as an application window (though I currently can't imagine how)?

- Scorputer

Share this post


Link to post
Share on other sites

maybe you can do it with a flash com object.

there is example scripts around the forum.

if it launchs online videos, u can run it with url that u grabbed from page`s source.

then send commands like $oSWF.play, $oSWF.fullscreen = true

just an opinion.


:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Share this post


Link to post
Share on other sites

maybe you can do it with a flash com object.

there is example scripts around the forum.

if it launchs online videos, u can run it with url that u grabbed from page`s source.

then send commands like $oSWF.play, $oSWF.fullscreen = true

just an opinion.

Aha! Thanks for the tip. I found that the following works:

ControlClick($iewindow1, "", "[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]", "left", 2, 15, 375) ; toggles Play/Pause to Play

.. where $iewindow1 is the name of the IE window. The last three numbers are the number of clicks, and the xy coordinates, provided by the "ControlClick Coords" supplied from the Window Info. I find it odd that I had to list 2 clicks to make the control work, but it works!

- Scorputer

Share this post


Link to post
Share on other sites

Is there any way to have IE open youtube and then mute the sound?

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