Sign in to follow this  
Followers 0
DesireDenied

_FF_YouTube_API

1 post in this topic

#1 ·  Posted (edited)

I am trying to get _FF_Youtube_API.au3 back to work but I think I got stuck.

This is my test code:

#include <FF.au3>
#include <_FF_Youtube_API.au3>

_FFConnect()
_FFTabAdd()

TestPlayer()


Func TestPlayer()
    If _FF_CreatePlayer("Mt1aJXH6AAs") Then
        Sleep(2000)
        _FF_YT("pauseVideo")
        _FF_YT("seekTo", 90)    
    EndIf
EndFunc

Func _FF_CreatePlayer($sVIDEOID = "")
    Local $sHTML =  '<html><head></head><body>' & _
                    '<object type="application/x-shockwave-flash" id="movie_player" style="width:640px; height:510px;"' & _
                    'data="http://www.youtube.com/v/#VIDEOID#?autoplay=1&amp;showsearch=0&amp;' & _
                    'version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1">' & _
                    '<param name="movie" value="http://www.youtube.com/watch?v=#VIDEOID#?autoplay=1&amp;' & _
                    'showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1" />'  & _
                    '<param name="allowFullScreen" value="true" />'  & _
                    '<param name="allowscriptaccess" value="always" /></object>' & _
                    '</body></html>'

    $sHTML = StringReplace($sHTML, "#VIDEOID#", $sVIDEOID)
    If _FFWriteHTML($sHTML) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

And this is what I get

_FFConnect: OS: WIN_7 WIN32_NT 7600
_FFConnect: AutoIt: 3.3.8.1
_FFConnect: FF.au3: 0.6.0.1b-3
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay: 2ms
_FFConnect: Socket: 604
_FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
__FFSendJavaScripts: Sending functions to FireFox .......... done
__FFSend: try{gBrowser.selectedTab = gBrowser.addTab('about:blank')}catch(e){'_FFCmd_Err';};
__FFRecv: [object XULElement] - {linkedBrowser: {...}, _tPos: 9, closing: false, mOverCloseButton: false, mCorrespondingMenuitem: null, _fullyOpen: false, arrowKeysShouldWrap: false, ...}
_FFLoadWait: . loaded in 98ms
__FFSend: try{content.document.body.innerHTML='<html><head></head><body><object type="application/x-shockwave-flash" id="movie_player" style="width:640px; height:510px;"data="http://www.youtube.com/v/Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1"><param name="movie" value="http://www.youtube.com/watch?v=Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /></object></body></html>';}catch(e){'_FFCmd_Err';};
__FFRecv: <html><head></head><body><object type="application/x-shockwave-flash" id="movie_player" style="width:640px; height:510px;"data="http://www.youtube.com/v/Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1"><param name="movie" value="http://www.youtube.com/watch?v=Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /></object></body></html>
__FFSend: try{window.content.wrappedJSObject.document.getElementById('movie_player').pauseVideo();}catch(e){'_FF_YT_Error'}
__FFRecv: _FF_YT_Error
__FFSend: try{window.content.wrappedJSObject.document.getElementById('movie_player').seekTo(90,true);}catch(e){'_FF_YT_Error'}
__FFRecv: _FF_YT_Error
+>22:58:35 AutoIT3.exe ended.rc:0

It seems like if Youtube wrapper can't find player object while for youtube page it works like a charm.

Does anyone know how to solve this problem?

Edited by DesireDenied

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

  • Similar Content

    • mattia100
      By mattia100
      HI!
      1) I want to create a FF web page in background... i want to say a web page that can't be seen in the application bar  but only in Windows Task Manager... 
      maybe using  __FFStartProcess? in fact i tried to use it but the parameter "hide" only can minimize the page, but not put it in background... 
      2) After creating this hide page, i would to open a macro of the iMacros addon, always all in hide mode...
      it is possible to do it?
      anybody can help me?
      Thanks!!
    • Danp2
      By Danp2
      UDF to control FireFox via MozRepl:
       FF_V0.6.0.1b-15_au3
      Change Log:
      Original thread: http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/
      Current development is occurring over on GitHub. The repo can be found here.
       
    • 5ervant
      By 5ervant
      Go create a quick account in Zapier and go to https://zapier.com/app/dashboard and make some Zaps!
      Just need to click the specific instance of an .open-menu button and then click its a.run (anchor) element.
      Doing this IE.au3 script just causing to click its container element:
      $target = 1; Target the first instance #include <IE.au3> $oIE = _IEAttach("Dashboard - Zapier") $count = 0; $tags = _IETagNameGetCollection($oIE, "div") For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "open-menu" Then $count += 1 if $count = $target Then MsgBox(0, "Instance: ", $count) ; $tag.fireEvent("onmousedown") ; _IEAction($tag, "click") ; $tag.fireEvent("onmouseup") ; Or this but not working ; $tag.Click EndIf EndIf Next I also tried to do it using FF.au3
      $target = 1; Target the first instance #Include <Array.au3> #Include <FF.au3> $count = 0; If _FFConnect(Default, Default, 3000) Then $aArray = _FFXPath( "//div[@class='open-menu']", "", 7 ) ; _ArrayDisplay($aArray) For $tag in $aArray $count += 1 if $count = $target Then MsgBox(0, "Instance: ", $count) _FFClick($tag) EndIf Next EndIf Error: _FFClick ==> No match: $sElement: [number]
      Could some help me how to click such buttons on such kind of a dynamic page?
    • jfcby
      By jfcby
      I have a script that sends multiple lines of text to a textbox using Firefox. I using _FFSetValue($sCellValue[7], "line one" & @CR & "line two", "id") from ff.au3. If it's a single line of text it works but MozRepl give the following error with multiple lines of text.
      Error:  
      __FFSend: try{FFau3.simulateEvent(window.content.top.document.getElementById('line one
      line two'),'Event','change',13);}catch(e){'_FFCmd_Err';};
      __FFWaitForRepl ==> Error return value: MozRepl ....>
      __FFSend: ;
      __FFRecv:
      __FFSend: FFau3.WCD=window.content.top.document;
      __FFWaitForRepl ==> Error return value: MozRepl ....>
      __FFRecv: !!! SyntaxError: unterminated string literal
      Details:

       [object HTMLDocument] - {mainForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...}
      !!! SyntaxError: unterminated string literal
      Will MozRepl plugin for Firefox send multiple lines of text to a textbox?
      Thanks for your help.
    • danielzy
      By danielzy
      Hey guys, I'm pretty new to autoit and I'm trying to use FF.au3 to extract some cells from a table which looks like that:
       
      <table border="0" cellspacing="5" cellpadding="1"> <tr> <td class="BlueInputKind" align="left" nowrap>HEADING1</td> <td class="BlueInputKind" nowrap>HEADING2</td> <td class="BlueInputKind" nowrap>HEADING3</td> <td class="BlueInputKind" nowrap>HEADING4</td> </tr> <tr> <td class="BlackTextEng" dir="ltr">Text1</td> <td class="BlackTextCenter" valign="top" dir="rtl">Number</td> <td nowrap class="BlackText" valign="top" nowrap>Text3</td> </tr> <tr> <td class="BlackTextEng" dir="ltr">Text1</td> <td class="BlackTextCenter" valign="top" dir="rtl">Number</td> <td nowrap class="BlackText" valign="top" nowrap>Text3</td> </tr> <tr> <td class="BlackTextEng" dir="ltr">Text1</td> <td class="BlackTextCenter" valign="top" dir="rtl">Number</td> <td nowrap class="BlackText" valign="top" nowrap>Text3</td> </tr> My end goal is to:
      If Text1 == something && Number > SomeNumber Then DoSomething I managed to connect to firefox using repl and clicked some links etc but I'm not even close to achieving something like the above. Any help will be appreciated.