overwolf.social.youtube

Provides access to the YouTube social provider.

Note: you can use overwolf.social.getDisabledServices() method to check if the service is available.

Methods

performUserLogin()

Version added: 0.125

Opens the login dialog.

There is no callback for this method and the only way to know if the user signed in is via the “onLoginStateChanged” event.

performLogout(callback)

Version added: 0.125

Performs a “strong” sign out of YouTube, so that even if the user performs a login via the Overwolf Settings / Accounts page, he will be considered signed out.

  • Parameter: callback <function>

     

    On success:

    { status: "success"}

    On failure:
    { status: "error", reason: [description] }

getUserInfo(callback)

Version added: 0.125

If the user is currently logged into YouTube, this will returns the user information.

 

  • Parameter: callback <function>

    Will contain user information or error if the request has failed.

Callback argument:
On success:

{ avatar: "http://abs.twimg.com/sticky/...", id: "111111111112222222" name: "full name" screenName: "screenname123"}

On failure:
{ status: "error", reason: [description] }

share(YouTubeShareParameters, callback)

Version added: 0.125

If the user is currently logged into YouTube, this will perform the video share.

|youTubeShareParams| is of type  errors that can occur:- Disconnected (user isn’t signed in)- MissingFile (trying to share a missing file)- UnsupportedFile (trying to share an unsupported format)

Events How to use events

onLoginStateChanged

Version added: 0.125

Fired when the user’s login state changes. 

Event value:
{ state = "connected" }

Or

{ state = "disconnected" }

Types

overwolf.social.youtube.YouTubeShareParameters

Options

file

<string>

The file to share.

title

<string>

The shared video's title.

description

<string>

The shared video's description.

trimming

<videosegment[]> — Optional

An object containing the start time and end time for the desired videosegment[]. 

tags

<string> — Optional

An array of chronological events that occurred during the capture.

gameClassId

<int> — Optional

The associated game's class ID.

gameTitle

<string> — Optional

The associated game's title.Optional parameter.