OpenVeo Publish server

API Docs for: 8.0.0
Show:

YoutubeProvider

Summary

Defines a YoutubeProvider class to interact with youtube platform.

Constructor

YoutubeProvider

Syntax

YoutubeProvider

(
  • providerConf
  • googleOAuthHelper
)

Summary

Parameters:

  • providerConf Object

    A youtube configuration object

    • uploadMethod String

      The upload method to use (see UPLOAD_METHODS)

    • privacy String

      The media privacy on Youtube (see PRIVACY_STATUSES)

  • googleOAuthHelper GoogleOAuthHelper

    The Google OAuth helper

Methods

getMediaInfo

Syntax

getMediaInfo

(
  • mediaId
  • callback
)
async

Summary

Gets information about a media hosted by Youtube.

Parameters:

  • mediaId String

    The Youtube id of the media

  • callback Function

    The function to call when it's done

    • Error The error if an error occurred, null otherwise
    • Object Information about the media

remove

Syntax

remove

(
  • mediaIds
  • callback
)
async

Summary

Removes a media from the Youtube platform.

Parameters:

  • mediaIds Array

    Youtube media ids to remove

  • callback Function

    The function to call when it's done

    • Error The error if an error occurred, null otherwise

update

Syntax

update

(
  • media
  • data
  • force
  • callback
)
async

Summary

Updates a media resources on the platform.

If media has several resources on the platform, the same update will be performed for all resources. Actually only the media title is synchronized with Youtube.

Parameters:

  • media Object

    The media

    • mediaId Array

      The list of media resource ids

  • data Object

    The datas to update

    • [title] String optional

      The media title. Be careful only the first 100 characters will be used, also "less than" and "greater than" characters will be removed

  • force Boolean

    true to force the update even if title hasn't changed, false otherwise

  • callback Function

    The function to call when it's done

    • Error The error if an error occurred, null otherwise

upload

Syntax

upload

(
  • mediaFilePath
  • callback
)
async

Summary

Uploads a media to the Youtube platform.

Parameters:

  • mediaFilePath String

    The absolute path of the media to upload

  • callback Function

    The function to call when it's done

    • Error The error if an error occurred, null otherwise
    • String The media id on the Youtube platform

uploadClassic

Syntax

uploadClassic

(
  • mediaFilePath
  • uploadParams
  • callback
)
async

Summary

Uploads to Youtube in the classic way, using Youtube API.

Parameters:

  • mediaFilePath String

    The absolute path to the media to upload

  • uploadParams Object

    Parameters to send to Youtube when calling the API

  • callback Function

    callback function with:

    • Error The error if an error occurred, null otherwise
    • String The media id on the Youtube platform

uploadResumable

Syntax

uploadResumable

(
  • mediaFilePath
  • uploadParams
  • callback
)
async

Summary

Uploads to Youtube in a fail safe way, using resumable uploads.

The upload can fail 3 times before failing globally, each times it fails it perform an upload again starting where it previously failed (ie: not re-uploading all the media)

Parameters:

  • mediaFilePath String

    The absolute path to the media to upload

  • uploadParams Object

    Parameters to send to Youtube when calling the API

  • callback Function

    callback function with:

    • Error The error if an error occurred, null otherwise
    • String The uploaded media id

Properties

CATEGORIES

Syntax

CATEGORIES

Object final static

Summary

Youtube category ids.

conf

Syntax

conf

Object final

Summary

The media platform's configuration.

googleOAuthHelper

Syntax

googleOAuthHelper

GoogleOAuthHelper

Summary

The Google OAuth Helper to use to connect to Google APIs.

privacy

Syntax

privacy

String

Summary

Privacy to apply to uploaded medias either public, private or unlisted.

PRIVACY_STATUSES

Syntax

PRIVACY_STATUSES

Array private final

Summary

Available privacy statuses.

UPLOAD_METHODS

Syntax

UPLOAD_METHODS

Array private final

Summary

Available upload methods.

uploadMethod

Syntax

uploadMethod

String

Summary

Youtube upload method, uploadClassic or uploadResumable.