Uploading a YouTube Video

Before you can manage a YouTube video, you must add it to Backlot.

Note: Due to rapid and unpredictable changes in YouTube requirements, playback for YouTube assets is supported only with older Ooyala players (Player v4.10.6 and earlier, and Player V3). Playback of YouTube assets uploaded to Backlot will not work with recent releases of Ooyala Player V4. Ooyala continues to support uploading of YouTube assets for content management purposes.
Note:
  • YouTube videos are sourced from YouTube. In Backlot, the video is represented as a YouTube asset with its YouTube ID, along with a title and description that you can edit.
  • There is a 1:1 correspondence between YouTube assets in Backlot and YouTube IDs. A YouTube ID is uniquely associated with one YouTube asset in Backlot. No two YouTube assets in your account can have the same YouTube ID. If you attempt to add a YouTube video that has been previously added, you receive the following error message (where asset_id identifies the previously created asset):
    "{"duplicate_youtube_id":["asset_id"]}"

To add a YouTube video:

Note: For more information about Backlot REST API commands, see the Backlot API Reference.
Use POST with the /v2/assets route and asset_type of youtube and the youtube_id in the request body. The following example adds the YouTube video with the dQw4w9WgXcQ YouTube ID.
[POST] /v2/assets{
   "name": "My Video",
   "asset_type": "youtube",
   "youtube_id": "dQw4w9WgXcQ" 
}

Backlot returns a response similar to the following.

{  
   "asset_type":"youtube",
   "duration":213,
   "name":"My YouTube Video",
   "preview_image_url":null,
   "created_at":"2011-08-10T00:04:05+00:00",
   "embed_code":"BnMDNxMjqmPTu",
   "time_restrictions":null,
   "updated_at":"2011-08-10T00:04:05+00:00",
   "youtube_id":"dQw4w9WgXcQ",
   "external_id":null,
   "hosted_at":null,
   "original_file_name":null,
   "description":"Music video by Rick Astley performing Never Gonna Give You Up. YouTube view counts pre-VEVO: 2,573,462 (C) 1987 PWL",
   "status":"live"
}
Note: Try out the code samples using your account credentials in the Ooyala Scratchpad. To launch the Scratchpad, go to Ooyala API Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad.

The video is successfully added.

Was this article helpful?