program builder Posted July 7, 2010 Share Posted July 7, 2010 I would like to be able to close youtube page after video playes, on anyvideo played. Is it possable? thanks. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 7, 2010 Share Posted July 7, 2010 Google "YouTube API" for tools. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
program builder Posted July 7, 2010 Author Share Posted July 7, 2010 (edited) I want the code to be written in autoit. What I need, is, a way to do a winwaitactive, where it waits for text, inside the page its self. Is that even possable? Edited July 7, 2010 by program builder Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 7, 2010 Share Posted July 7, 2010 It's being played by an API in the browser. So if it's IE, you might inject some Javascript to use the Player API and check the status in a loop: player.getPlayerState():Number Returns the state of the player. Possible values are unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5). ...or trigger by the onStateChange event: Events onStateChange This event is fired whenever the player's state changes. Possible values are unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5). When the SWF is first loaded it will broadcast an unstarted (-1) event. When the video is cued and ready to play it will broadcast a video cued event (5).Subscribing to Events Subscribe to events by adding an event listener to the player reference. For example, to get notified when the player's state changes, add an event listener for onStateChange and include a callback function. function onYouTubePlayerReady(playerId) { ytplayer = document.getElementById("myytplayer"); ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); } function onytplayerStateChange(newState) { alert("Player's new state: " + newState); } Good luck with it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
program builder Posted July 7, 2010 Author Share Posted July 7, 2010 Is that even Autoit script? I need autoit script. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 7, 2010 Share Posted July 7, 2010 No, Javascript run within the HTML of of web page. To some extent, AutoIt can inject and kick off the javascript, but I don't think there is an interface to control it directly from outside the browser. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
program builder Posted July 7, 2010 Author Share Posted July 7, 2010 (edited) at the end of most of the videos, it says if you like... is there any way to have autoit read the text, and shut down the page? Edited July 7, 2010 by program builder Link to comment Share on other sites More sharing options...
program builder Posted July 7, 2010 Author Share Posted July 7, 2010 would something like this work? ControlGetHandle("If you like", "", "") could someone give me the correct code? Link to comment Share on other sites More sharing options...
program builder Posted July 7, 2010 Author Share Posted July 7, 2010 ;why isn't this working? while 1 if winactive("YouTube", "If you like") then send("{altdown}{f4}{altup}") endif wend Link to comment Share on other sites More sharing options...
program builder Posted July 7, 2010 Author Share Posted July 7, 2010 Let me refrase the question. Is there any way to read text inside of a webpage. maybe that will get an answer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now