Using the Video Stitcher API, you create a video-on-demand (VOD) session each time you dynamically insert ads prior to delivery to client devices. When you create a session, the response includes the playback URL and information about the ads that you inserted into the video.
This page describes how to create and manage a VOD session that is not enabled by Google Ad Manager. For more information on these types of VOD sessions, see Manage a VOD session enabled by Google Ad Manager.
Before you begin
Create a session
To create a session for an ad-stitched video, use the
projects.locations.vodSessions.create
method.
When you create a VOD session, the following field is required:
adTracking
: determines if the client player is expected to trigger playback and activity events or if the Video Stitcher API is expected to trigger playback events on behalf of the client player; for more information on client-side ad tracking, see Handle VOD client ad tracking.The example in this section uses server-side ad tracking.
When you create a VOD session, the following fields are optional:
adTagMacroMap
: a list of key-value pairs for ad tag macro replacement; see the ad tag macros sectionmanifestOptions
: specifies which video renditions are generated in the stitched video manifest and the ordering of the renditions; see the manifest options documentation
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number located in the Project number field on the IAM Settings pageLOCATION
: the location in which to create your session; use one of the supported regionsShow locationsus-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
VOD_CONFIG_ID
: the user-defined identifier for the VOD config
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID", "interstitials": { "sessionContent": { "duration": "60s" } }, "playUri": "PLAY_URI", # This is the ad-stitched VOD URI "sourceUri": "VOD_URI", "adTagUri": "AD_TAG_URI", "assetId": "ASSET_ID", "adTracking": "SERVER", "vodConfig": "projects/PROJECT_NUMBER/locations/LOCATION/vodConfigs/VOD_CONFIG_ID" }
C#
Before trying this sample, follow the C# setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API C# API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Go API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Java API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Node.js API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
The Video Stitcher API generates a unique session ID for each request. A session expires after 4 hours.
An ad must be encoded before it can be stitched into a VOD session. When you create a session for an ad-stitched video, the Video Stitcher API determines if the ad has already been encoded from a previous session. If it has, the JSON response will indicate ad break events. The API only looks for encoded ads created by sessions associated with your Google Cloud project. For more information on this process, see the Overview.
Look at the JSON response. This response indicates that an ad was not stitched into the session. If this is the case, wait 5 minutes (for ad encoding) and then re-run the create session command. The response should now be similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID", "interstitials": { "adBreaks": [ { "progressEvents": [ { "timeOffset": "0s", "events": [ { "type": "IMPRESSION", "uri": "https://securepubads.g.doubleclick.net/pcs/view..." }, { "type": "START", "uri": "https://pubads.g.doubleclick.net/pagead/interaction/..." }, ... ] }, ... ], "ads": [ { "duration": "10s", "activityEvents": [ { "type": "ERROR", "uri": "https://pubads.g.doubleclick.net/pagead/interaction/..." }, { "type": "CLICK_THROUGH", "uri": "https://pubads.g.doubleclick.net/pcs/click...", "id": "GDFP" }, ... ] } ], "endTimeOffset": "10s", "startTimeOffset": "0s" } ], "sessionContent": { "duration": "70s" } }, "playUri": "PLAY_URI", "sourceUri": "VOD_URI", "adTagUri": "AD_TAG_URI", "assetId": "ASSET_ID", "adTracking": "SERVER", "vodConfig": "projects/PROJECT_NUMBER/locations/LOCATION/vodConfigs/VOD_CONFIG_ID" }
The response is a VOD session object that contains the following fields:
- A
name
field that shows the VODSESSION_ID
. Use this ID to get information about the session. - An
interstitials
object that contains metadata about the ads that were inserted (see the ad metadata concepts). - A
playUri
field that shows the URL that the client device uses to play the conditioned video asset.
If you're generating a session on behalf of your customers' devices, set the following parameters using HTTP headers:
Parameter | HTTP Header |
---|---|
CLIENT_IP |
x-user-ip |
REFERRER_URL |
referer |
USER_AGENT |
user-agent |
You can add the following headers to the preceding curl
request:
-H "x-user-ip: CLIENT_IP" \ -H "referer: REFERRER_URL" \ -H "user-agent: USER_AGENT" \
Ad tag macros
An ad tag can contain macros, which can result in a different ad tag for each session. Macros are denoted by square brackets in the ad tag, as illustrated by the following example:
AD_TAG_URI¯o=[my-key]
The adTagUri
is defined in the VOD config.
To substitute the value in the ad tag macro, provide a mapping in the
adTagMacroMap
field. For example, if you want to replace
the [my-key]
macro with the string my-value
, you need to provide the
following:
{ ... "adTagMacroMap": { "my-key": "my-value" }, ... }
When the Video Stitcher API requests the ad metadata, it uses the following ad tag:
AD_TAG_URI¯o=my-value
Get a session
To get the session for an ad-stitched video, use the
projects.locations.vodSessions.get
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number located in the Project number field on the IAM Settings pageLOCATION
: the location of your session; use one of the supported regionsShow locationsus-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
SESSION_ID
: the identifier for the VOD session
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID", "interstitials": { "adBreaks": [ { "progressEvents": [ { "timeOffset": "0s", "events": [ { "type": "IMPRESSION", "uri": "https://securepubads.g.doubleclick.net/pcs/view..." }, { "type": "START", "uri": "https://pubads.g.doubleclick.net/pagead/interaction/..." }, ... ] }, ... ], "ads": [ { "duration": "10s", "activityEvents": [ { "type": "ERROR", "uri": "https://pubads.g.doubleclick.net/pagead/interaction/..." }, { "type": "CLICK_THROUGH", "uri": "https://pubads.g.doubleclick.net/pcs/click...", "id": "GDFP" }, ... ] } ], "endTimeOffset": "10s", "startTimeOffset": "0s" } ], "sessionContent": { "duration": "70s" } }, "playUri": "PLAY_URI", "sourceUri": "VOD_URI", "adTagUri": "AD_TAG_URI", "assetId": "ASSET_ID", "adTracking": "SERVER", "vodConfig": "projects/PROJECT_NUMBER/locations/LOCATION/vodConfigs/VOD_CONFIG_ID" }
C#
Before trying this sample, follow the C# setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API C# API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Go API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Java API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Node.js API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
Before trying this sample, follow the PHP setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API PHP API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
Before trying this sample, follow the Ruby setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Ruby API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Sample ad-stitched playlist
The following shows a sample source VOD playlist before ad stitching:
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXT-X-VERSION:4
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.000,
segment_01.ts
#EXTINF:6.000,
segment_02.ts
#EXTINF:6.000,
segment_03.ts
#EXTINF:6.000,
segment_04.ts
#EXTINF:6.000,
segment_05.ts
#EXTINF:6.000,
segment_06.ts
#EXT-X-ENDLIST
The following shows a sample source VOD playlist after ad stitching with pre-roll, mid-roll, and post-roll ads:
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:6
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-DISCONTINUITY
#EXTINF:4.000,
https://ads.us-west1.cdn.videostitcher.goog/preroll_ad/seg_01.ts
#EXTINF:4.000,
https://ads.us-west1.cdn.videostitcher.goog/preroll_ad/seg_02.ts
#EXTINF:1.990,
https://ads.us-west1.cdn.videostitcher.goog/preroll_ad/seg_03.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.000,
segment_01.ts
#EXTINF:6.000,
segment_02.ts
#EXT-X-DISCONTINUITY
#EXTINF:4.000,
https://ads.us-west1.cdn.videostitcher.goog/midroll_ad/seg_01.ts
#EXTINF:0.990,
https://ads.us-west1.cdn.videostitcher.goog/midroll_ad/seg_02.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.000,
segment_03.ts
#EXTINF:6.000,
segment_04.ts
#EXTINF:6.000,
segment_05.ts
#EXTINF:6.000,
segment_06.ts
#EXT-X-DISCONTINUITY
#EXTINF:4.000,
https://ads.us-west1.cdn.videostitcher.goog/postroll_ad/seg_01.ts
#EXTINF:4.000,
https://ads.us-west1.cdn.videostitcher.goog/postroll_ad/seg_02.ts
#EXTINF:1.990,
https://ads.us-west1.cdn.videostitcher.goog/postroll_ad/seg_03.ts
#EXT-X-ENDLIST
Handle client-side ad tracking
When client ad tracking is enabled, the player is responsible for triggering ad tracking events. You can find client-side tracking information in the interstitials object returned when the VOD session is created.
The interstitials object includes ad tracking information and metadata for companion ads parsed from ad tag requests. To inspect which ads are stitched, see Inspect VOD sessions.
Interstitials
Ad tracking information is grouped by ad breaks in the
interstitials
object.
Ad breaks may have progress events which specify the event URI and the time
offset relative to the break start time for each event that has been fired. For
more details about progress events, see the ProgressEvent
reference documentation.
Ad breaks may also have activity events and companion ads. For more details
about companion ads, see the CompanionAds
reference
documentation.
The following is an interstitials example:
{
"adBreaks": [
{
"progressEvents": [
{
"timeOffset": "0s",
"events": [
{
"type": "IMPRESSION",
"uri": "https://example.com/impression"
},
{
"type": "START",
"uri": "https://example.com/start"
}
]
},
{
"timeOffset": "1.250s",
"events": [
{
"type": "FIRST_QUARTILE",
"uri": "https://example.com/firstquartile"
}
]
}
],
"ads": [
{
"duration": "5s",
"activityEvents": [
{
"type": "PAUSE",
"uri": "https://example.com/pause"
}
],
"companionAds": {
"required": "all",
"companions": [
{
"width": 200,
"height": 100,
"staticResource": {
"uri": "https://example.com/static.png",
"creativeType": "image/png"
}
}
]
}
},
{
"duration": "10s"
}
],
"startTimeOffset": "0s",
"endTimeOffset": "15.000s"
}
],
"sessionContent": {
"duration": "120.000s"
}
}
In the preceding example, there is one pre-roll ad break with two ads stitched
into a VOD asset. The duration of the first ad is 5 seconds and the duration of
the second ad is 10 seconds. The total stitched video length is 120 seconds, as
identified by the duration
field in sessionContent
.
When the client receives this object, it should do the following:
- Make a request to
https://example.com/start
at the start of the ad break. - Make a request to
https://example.com/impression
at the start of the ad break. - Make a request to
https://example.com/pause
whenever the viewer pauses the video during the first ad. - Make a request to
https://example.com/firstQuartile
1.25 seconds into the first ad. - Load the companion ad
https://example.com/static.png
during the first ad.
Inspect VOD sessions
This section describes how to inspect the ad tag details and stitch details for
a given VOD session. For more details, see the REST documentation for
VodAdTagDetail
and
VodStitchDetail
.
The adTagUri
field, defined in the VOD config for the VOD session, specifies
the URL from where ad metadata is retrieved. The Video Stitcher API also includes
user metadata when it makes the request.
The /vodAdTagDetails
endpoint contains the following information:
- resolved ad tag
- user metadata
- request body and headers
- response body and headers
The /vodStitchDetails
endpoint contains the following information:
- ad break ID
- ad ID
- ad time offset (in seconds)
- reason if the ad was not inserted
- ad media metadata
List ad tag details
To list the ad tag details for a VOD session, use the
projects.locations.vodSessions.vodAdTagDetails.list
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number located in the Project number field on the IAM Settings pageLOCATION
: the location of your session; use one of the supported regionsShow locationsus-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
SESSION_ID
: the session ID for the VOD session
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "vodAdTagDetails" : [ { "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodAdTagDetails/VOD_AD_TAG_DETAILS_ID", "adRequests": [ { "uri": "REQUEST_URL", "requestMetadata": "AD_TAG_REQUEST_METADATA", "responseMetadata": "AD_TAG_RESPONSE_METADATA" } ] } ] }
C#
Before trying this sample, follow the C# setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API C# API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Go API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Java API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Node.js API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
Before trying this sample, follow the PHP setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API PHP API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
Before trying this sample, follow the Ruby setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Ruby API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
The response returns a list of
VodAdTagDetail
objects. Each
VodAdTagDetail
represents the ad
retrieval metadata for an ad tag, and each
AdRequest
represents the ad request metadata
for a single ad request.
Additional results
The curl
response may include a nextPageToken
, which you can use to retrieve
additional results:
{ "vodAdTagDetails": [ ... ], "nextPageToken": "NEXT_PAGE_TOKEN" }
You can send another curl
request, including the value of
NEXT_PAGE_TOKEN
, to list the additional objects. Append
the following to the URL in the preceding API call:
?pageToken=NEXT_PAGE_TOKEN
Get ad tag details
To get the details for a single VodAdTagDetail
object in a VOD session, use
the
projects.locations.vodSessions.vodAdTagDetails.get
method.
The following example demonstrates viewing a single ad tag detail for a VOD session using the name of an ad tag detail returned from a previous request:
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number located in the Project number field on the IAM Settings pageLOCATION
: the location of your session; use one of the supported regionsShow locationsus-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
SESSION_ID
: the session ID for the VOD sessionVOD_AD_TAG_DETAILS_ID
: the ID for the VOD ad tag details
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodAdTagDetails/VOD_AD_TAG_DETAILS_ID", "adRequests": [ { "uri": "REQUEST_URL", "requestMetadata": "AD_TAG_REQUEST_METADATA", "responseMetadata": "AD_TAG_RESPONSE_METADATA" } ] }
C#
Before trying this sample, follow the C# setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API C# API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Go API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Java API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Node.js API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
Before trying this sample, follow the PHP setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API PHP API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
Before trying this sample, follow the Ruby setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Ruby API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
List stitch details
You can view detailed information about the ads that were stitched for any VOD session.
To list the stitch details for a VOD session, use the
projects.locations.vodSessions.vodStitchDetails.list
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number located in the Project number field on the IAM Settings pageLOCATION
: the location of your session; use one of the supported regionsShow locationsus-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
SESSION_ID
: the session ID for the VOD session
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "vodStitchDetails" : [ { "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodStitchDetails/VOD_STITCH_DETAILS_ID", "adStitchDetails": [ { "adBreakId": "AD_BREAK_ID", "adId": "AD_ID", "adTimeOffset": "AD_TIME_OFFSET", "skipReason": "SKIP_REASON", "media": "MEDIA_OBJECT" }, { "adBreakId": "my-other-ad-break-id", "adId": "my-other-ad-id", "adTimeOffset": "my-other-ad-time-offset", "skipReason": "my-other-skip-reason", "media": "my-other-media-object" } ] } ] }
C#
Before trying this sample, follow the C# setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API C# API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Go API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Java API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Node.js API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
Before trying this sample, follow the PHP setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API PHP API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
Before trying this sample, follow the Ruby setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Ruby API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
The response returns a list of
VodStitchDetail
objects. Each
VodStitchDetail
represents the stitch detail for an ad tag, and each
adStitchDetails
object represents the
stitch detail for a single ad.
The curl
response may include a nextPageToken
, which you can use to retrieve
additional results.
Get ad tag stitch detail
To get the stitch detail for a single ad tag for a VOD session, use the
projects.locations.vodSessions.vodStitchDetails.get
method.
The following example demonstrates viewing a single ad tag stitch detail for a VOD session using the name of an stitch ad tag detail returned from a previous request:
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number located in the Project number field on the IAM Settings pageLOCATION
: the location of your session; use one of the supported regionsShow locationsus-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
SESSION_ID
: the session ID for the VOD sessionVOD_STITCH_DETAILS_ID
: the ID for the VOD stitch details
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodStitchDetails/VOD_STITCH_DETAILS_ID", "adStitchDetails": [ { "adBreakId": "AD_BREAK_ID", "adId": "AD_ID", "adTimeOffset": "AD_TIME_OFFSET", "skipReason": "SKIP_REASON", "media": "MEDIA_OBJECT" } ] }
C#
Before trying this sample, follow the C# setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API C# API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Go API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Java API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Node.js API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
Before trying this sample, follow the PHP setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API PHP API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
Before trying this sample, follow the Ruby setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Ruby API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.