overwolf.social.youtube API
Provides access to the YouTube social provider.
You can use verwolf.social.getDisabledServices()
method to check if the service is available.
Methods Reference
- overwolf.social.youtube.performUserLogin()
- overwolf.social.youtube.performLogout()
- overwolf.social.youtube.getUserInfo()
- overwolf.social.youtube.share()
- overwolf.social.youtube.shareEx()
- overwolf.social.youtube.cancelShare()
Events Reference
Types Reference
- overwolf.social.youtube.YouTubeShareParameters Object
- overwolf.social.youtube.SocialShareResult Object
- overwolf.social.youtube.SocialShareProgress Object
- overwolf.social.youtube.enums.ShareState Enum
- overwolf.social.youtube.YouTubePrivacy Enum
performUserLogin()
Version added: 0.128
Opens the login dialog.
There is no callback for this method and the only way to know if the user signed in is via 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 | Type | Description |
---|---|---|
callback | (Result) => void | A callback function which will be called with the status of the request |
getUserInfo(callback)
Version added: 0.125
If the user is currently logged into YouTube, this will return user information, Otherwise, an error is returned.
Parameter | Type | Description |
---|---|---|
callback | (Result: GetUserInfoResult) => void | A callback function which will be called with the status of the request |
share(YouTubeShareParameters, callback)
Version added: 0.125
If the user is currently logged into YouTube, this will perform the video share.
Parameter | Type | Description |
---|---|---|
youTubeShareParams | YouTubeShareParameters Object | The share parameters |
callback | (Result) => void | A callback function which will be called with the status of the request |
Types of errors that can occur:
- Disconnected (user isn't signed in)
- MissingFile (trying to share a missing file)
- UnsupportedFile (trying to share an unsupported format)
- Forbidden (user did not give Overwolf permissions to upload videos)
- NoChannelsFound (user does not have a youtube channel associated with this Google account)
shareEx(YouTubeShareParameters, callback, callback)
Version added: 0.198
If the user is currently logged into Youtube, this will perform the video share.
Parameter | Type | Description |
---|---|---|
youtubeShareParams | YoutubeShareParameters Object | The share parameters |
resultCallback | (SocialShareResult) => void | A callback function which will be called with the resulting status of the request |
progressCallback | (socialShareProgress) => void | A callback function which will be called whenever share progress is made. See note |
Types of errors that can occur:
- Disconnected (user isn't signed in)
- MissingFile (trying to share a missing file)
- UnsupportedFile (trying to share an unsupported format)
- Forbidden (user did not give Overwolf permissions to upload videos)
- NoChannelsFound (user does not have a youtube channel associated with this Google account)
Progress Note
This callback will only be called when uploading a video.
Videos will be uploaded in uniforamlly sized chunks (except for the last chunk). The callback will be called every time another chunk was successfully uploaded.
cancelShare(string, callback)
Version added: 0.198
cancels an ongoing share request with the given id, if valid. Callback will be invoked with success if such a request was found and a cancellation order was executed (may take a while)
Parameter | Type | Description |
---|---|---|
id | string | The request ID |
callback | (Result) => void | Called with the result of the cancellation |
overwolf.social.youtube.cancelShare("2", console.log)
onLoginStateChanged
Version added: 0.125
Fired when the user’s login state changes, with the following structure: LoginStateChangedEvent Object.
YouTubeShareParameters Object
Version added: 0.125
This object defines all parameters that can/should be passed to the Youtube
share()
andshareEx()
methods.
Parameter | Type | Description |
---|---|---|
file | string | The file to share |
id (Optional) | string | The ID for the current share request. See note |
useOverwolfNotifications | boolean | Whether or not Overwolf notifications should be used. See note |
title | string | The shared video's title |
description | string | The shared video's description |
trimming (Optional) | VideoCompositionSegment | An object containing start time and end time for the desired VideoCompositionSegment |
privacy | YouTubePrivacy | The privacy policy of the uploaded video, defaults to public |
tags (Optional) | string | An array of chronological events that occurred during the capture |
gameClassId (Optional) | int | The associated game's class ID |
gameTitle (Optional) | string | The associated game's title |
metadata (Optional) | Object | Extra information about the game session |
id note
When calling overwolf.social.youtube.shareEx()
, it is required to supply it with a request ID. This ID will also be used in case you wish to cancel this share using overwolf.social.youtube.cancelShare()
.
useOverwolfNotifications note
When calling overwolf.social.youtube.share()
, this will default to true.
When calling overwolf.social.youtube.shareEx()
, this will default to false.
SocialShareResult Object
Version added: 0.198
Container for the url shared in a successful share.
Parameter | Type | Description |
---|---|---|
url | string | The url of the generated result |
Example data
{
"url": "https://www.youtube.com/watch?v=iik25wq1251"
}
SocialShareProgress Object
Version added: 0.198
The current progress of the share request
Parameter | Type | Description |
---|---|---|
progress | int | The current precentage of upload progress |
id | string | The id of the share request |
state | ShareState | The current state of the share request |
Example data
{
"progress": 99,
"id": "7",
"state": "Uploading"
}
ShareState Enum
Version added: 0.198
The current state of the
overwolf.social.youtube.shareEx()
operation.
Options | Description |
---|---|
Started | The upload has started |
Uploading | The upload is in progress |
Finished | The upload has finished |
YouTubePrivacy Enum
version added: 0.198
The listing status of the uplaoded video.
Option | Description |
---|---|
Public | The video will be public |
Unlisted | The video will be unlisted |
Private | The video will be private |
id | string |
state | string |