Jump to content

Google API and where to start


Damein
 Share

Recommended Posts

Alright, I have been searching and researching for almost 2 hours now. I know how to use the Gdata now, which can do somethings I want to be able to do. But the one thing that I REALLY want to do is get the state of the video. IE: Is it playing or is it paused? I have been lost in ObjCreate and can't seem to figure out how to actually embed a flash player (that will then allow me to use Google's Flash API) into a GUI with IE embedded.

I found parts of a script and tried doing what I wanted with it. This is what I came up with.

#include <IE.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include "SWF.au3"
#include <AviConstants.au3>

Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
Global $flash = GUICreate("Videos", 800, 800, Default, Default, BitOR($WS_POPUPWINDOW, $WS_EX_TOPMOST, $DS_SETFOREGROUND))
WinSetOnTop("Videos", "", 1)
Global $vid = GUICtrlCreateObj($oRP, 10, 10, 780, 780)
With $oRP
  .bgcolor = "#ffffff"
  .Movie = 'http://www.youtube.com/v/QxFe9Vaxq0A?f?version=3'
  .ScaleMode = 1
  .Loop = "True"
  .wmode = "transparent"
  .FlashVars = ""
  .Play()
  .player.mute()
EndWith
GUISetState()
While 1
$Msg = GuiGetMsg()
If $Msg = $GUI_EVENT_CLOSE Then
  Exit
EndIf
Sleep(10)
WEnd

It seems to load the API, and I can set the video to playing using .Movie but I cannot interact with it after that. Maybe I am doing it wrong, I dunno. Any help would be great.

Here is the API info I am trying to use:

http://code.google.com/apis/youtube/flash_api_reference.html#Playback_controls

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

Any COM guru's wanna help me out with this, I would really love to be able to implement this :D

Either way, time to start scouring the help files!

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

So, I had an idea to embed the YouTube video to try and control it that way. I was able to succesfully embed it, and add an autostart command to it. But I still don't know how I would then pull the state of the YouTube video (Playing, Paused, Ended) etc.

Here's what I tried doing.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
$oIE = _IECreateEmbedded()
$Form1 = GUICreate("_IEDocWriteHTML Demo", 600, 400)
$Obj1 = GUICtrlCreateObj($oIE, 5, 5, 590, 390)
_IENavigate($oIE, "about:blank")
GUISetState(@SW_SHOW)

$Html = '<object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/u1zgFlCw8Aw?fs=1"</param> <param name="allowFullScreen" value="true"></param> <param name="allowScriptAccess" value="always"></param> <embed src="http://www.youtube.com/v/u1zgFlCw8Aw?fs=1&autoplay=1&enablejsapi=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="425" height="344"> </embed> </object>'
SplashTextOn(@ScriptDir, "Please wait", 200, 50)
_IEDocWriteHTML($oIE, $Html)
SplashOff()
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

So yeah, I don't know if this is a step in the right direction, but I've been trying new things!

Edited by Damein

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

As a side note, I haven't ever used iFrames. Would this work better?

http://code.google.com/apis/youtube/iframe_api_reference.html

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

Alright, I figured out why this doesn't work. You have to have your code uploaded to a webserver in order to do this :D

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...