Stilgar Posted March 21, 2009 Posted March 21, 2009 (edited) Just a simple YouTube API wrapper for the FF.au3:_FF_YouTube_API.au3works with all pages which uses the YouTube-API.Supported commands:loadWait / $vArg1 = TimeOut in ms (int), Default = 10000playVideopauseVideostopVideoclearVideogetVideoBytesLoadedgetvideobytestotalgetVideoStartBytesmuteunMuteisMutedsetVolume / $vArg1 = Volume (int) (min=0, max=100)getVolumeseekTo / $vArg1 = Secs (int) / $vArg2 = allowSeekAhead (boolean), Default = truegetPlayerStategetCurrentTimegetDurationsetSize / $vArg1 = height (int) / $vArg2 = width (int) (min=50)getVideoUrlgetVideoEmbedCodeloadVideoById / $vArg1 = id (string) / $vArg2 = start (int)cueVideoById / $vArg1 = id (string) / $vArg2 = start (int)Requirement(s).: FF.au3 >= 0.5.3.0 / MozReplExample:#include <FF.au3> #include <_FF_YouTube_API.au3> If _FFConnect() Then _FFTabAdd("http://www.youtube.com/watch?v=T-99HbI8zec") If _FF_YT("loadWait") Then _FF_YT("playVideo") Sleep(10000) _FF_YT("pauseVideo") _FF_YT("seekTo", 90) Sleep(3000) _FF_YT("setSize", 300) MsgBox(64, "Video size in Bytes:", _FF_YT("getVideoBytesTotal")) Sleep(5000) _FF_YT("stopVideo") EndIf _FFTabClose("YouTube - Fergie Ferg(.*?)-", "label") EndIf Edited April 29, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF
iLoveAU3 Posted March 24, 2009 Posted March 24, 2009 Hey Stilgar, do you know why "loadVideoById" / "cueVideoById" does not work properly directly on YT? movie player always return "We're sorry, this video is no longer available", playerState=3 and then I can't even get videoId. this is part of code i have added for those functions. Case "loadVideoById" $vArg1 = String($vArg1) $vArg2 = Number($vArg2) If $vArg2 = Default Or $vArg2 = "" Then $vArg2 = 0 If IsString($vArg1) And IsNumber($vArg2) Then $sCommand = "loadVideoById('" & $vArg1 & "'," & $vArg2 &")" EndIf Case "cueVideoById" $vArg1 = String($vArg1) $vArg2 = Number($vArg2) If $vArg2 = Default Or $vArg2 = "" Then $vArg2 = 0 If IsString($vArg1) And IsNumber($vArg2) Then $sCommand = 'cueVideoById("' & $vArg1 & '",' & $vArg2 &")" EndIf nice work anyway!
Stilgar Posted March 25, 2009 Author Posted March 25, 2009 Hello, thank you! That's an problem on YouTube, if you try this on an other page it works: _FFTabAdd($Socket,"http://code.google.com/intl/de-DE/apis/youtube/js_example_1.html") _FF_YT($Socket,"loadVideoById","T-99HbI8zec",0,"myytplayer") ; FF.au3 V0.5: _FFTabAdd("http://code.google.com/intl/de-DE/apis/youtube/js_example_1.html") _FF_YT("loadVideoById","T-99HbI8zec",0,"myytplayer") but I don't no where this limitation comes from. With your permission I add your code to the next version. jEdit4AutoIt PlanMaker_UDF
iLoveAU3 Posted March 25, 2009 Posted March 25, 2009 that is right, it works fine except for yt page. of course, feel free to use this code
Stilgar Posted March 25, 2009 Author Posted March 25, 2009 I've uploaded a new version for FF.au3 > 0.5 - new: loadVideoById, by iLoveAU3 - new: cueVideoById, by iLoveAU3 Download and example at the first post. jEdit4AutoIt PlanMaker_UDF
Stilgar Posted April 28, 2009 Author Posted April 28, 2009 Updated to FF.au3 > V0.5.3.0. jEdit4AutoIt PlanMaker_UDF
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