Making Remote Assets Available on YouTube

To make a remote asset available on YouTube, you need to setup a YouTube syndication (only once), upload a video to YouTube, create a remote asset in Backlot, add the YouTube ID to the asset, and add a label to the asset that triggers the YouTube syndication.

Note: For more information about Backlot REST API commands, see the Backlot API Reference.

To make a remote asset available on YouTube:

  1. Setup a YouTube syndication (only once). The following example creates a YouTube syndication that uses the syndicate_to_youtube label (48951b2ed95a4e13b8a3b07d59ac6ec1).
    [POST]/v2/syndications{  
       "asset_types":[  
          "remote_asset"
       ],
       "include_all_content":false,
       "include_labels":[  
          "48951b2ed95a4e13b8a3b07d59ac6ec1"
       ],
       "name":"YouTube",
       "should_create_youtube_videos":true,
       "should_delete_youtube_videos":true,
       "type":"youtube",
       "username":"my_username",
       "password":"my_password"
    }

    Backlot returns a response similar to the following.

    {  
       "name":"YouTube",
       "require_access_key":false,
       "created_at":"2011-03-31T22:38:34+00:00",
       "include_labels":[  
          "48951b2ed95a4e13b8a3b07d59ac6ec1"
       ],
       "should_create_youtube_videos":true,
       "asset_types":[  
          "remote_asset"
       ],
       "username":"my_username",
       "id":"716437dedfa443bbb69c7101cf3574c0",
       "include_all_content":false,
       "type":"youtube",
       "should_delete_youtube_videos":true
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  2. Upload the video to YouTube and get the YouTube ID. For more information on uploading videos to YouTube, refer to the YouTube Web Site. In this example, the YouTube ID is dQw4w9WgXcQ for the following URL:
     http://www.youtube.com/watch?v=dQw4w9WgXcQ
        
  3. Create a remote asset in Backlot. The following example creates a remote asset that points to the original location of the remote asset (not the YouTube link).
    [POST]/v2/assets{  
       "name":"A new remote asset",
       "asset_type":"remote_asset",
       "duration":120000,
       "stream_urls":{  
          "flash":"http://example.com/my_flash_file.flv",
          "iphone":"http://example.com/iphone_compatible_file.mp4"
       }
    }

    Backlot returns a response similar to the following.

    {  
       "asset_type":"remote_asset",
       "duration":120000,
       "name":"A new remote asset",
       "preview_image_url":null,
       "created_at":"2011-09-12T17:47:03+00:00",
       "embed_code":"c1cWxzMjo6AKb_NhHAQiXx9mvAY4mG-D",
       "stream_urls":{  
          "ipad":null,
          "source_file":null,
          "iphone":"http://example.com/iphone_compatible_file.mp4",
          "flash":"http://example.com/my_flash_file.flv",
          "itunes":null
       },
       "time_restrictions":null,
       "updated_at":"2011-09-12T17:47:04+00:00",
       "external_id":null,
       "hosted_at":null,
       "original_file_name":null,
       "description":null,
       "status":"live"
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  4. Associate the YouTube ID with the asset. The following example associates the dQw4w9WgXcQ YouTube ID with the c1cWxzMjo6AKb_NhHAQiXx9mvAY4mG-D asset.
    [PATCH]/v2/assets/c1cWxzMjo6AKb_NhHAQiXx9mvAY4mG-D/youtube{  
       “youtube_id”:“dQw4w9WgXcQ"
    }

    Backlot returns a response similar to the following.

    {  
       "author":"RickAstleyVEVO",
       "youtube_id":"dQw4w9WgXcQ",
       "youtube_syndication_settings":{  
          "private":null,
          "mobile":null,
          "embeddable":null,
          "keywords":null
       }
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  5. Associate the label with the asset. The following example associates the syndicate_to_youtube label (48951b2ed95a4e13b8a3b07d59ac6ec1) with the c1cWxzMjo6AKb_NhHAQiXx9mvAY4mG-D asset.
    [PATCH]/v2/assets/c1cWxzMjo6AKb_NhHAQiXx9mvAY4mG-D/labels/48951b2ed95a4e13b8a3b07d59ac6ec1

    Backlot returns a response similar to the following.

    {  
       "items":[  
          {  
             "name":"syndicate_to_youtube",
             "id":"48951b2ed95a4e13b8a3b07d59ac6ec1",
             "full_name":"/syndicate_to_youtube",
             "parent_id":null
          }
       ]
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

The remote asset is available on YouTube.

Was this article helpful?