MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

media/video-stitcher/createVodConfig.js:18–57  ·  view source on GitHub ↗
(projectId, location, vodConfigId, sourceUri, adTagUri)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, vodConfigId, sourceUri, adTagUri) {
19 // [START videostitcher_create_vod_config]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // vodConfigId = 'my-vod-config-id';
26 // sourceUri = 'https://storage.googleapis.com/my-bucket/main.mpd';
27 // See VMAP Pre-roll
28 // (https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags)
29 // adTagUri = 'https://pubads.g.doubleclick.net/gampad/ads...';
30
31 // Imports the Video Stitcher library
32 const {VideoStitcherServiceClient} =
33 require('@google-cloud/video-stitcher').v1;
34 // Instantiates a client
35 const stitcherClient = new VideoStitcherServiceClient();
36
37 async function createVodConfig() {
38 // Construct request
39 const request = {
40 parent: stitcherClient.locationPath(projectId, location),
41 vodConfig: {
42 sourceUri: sourceUri,
43 adTagUri: adTagUri,
44 },
45 vodConfigId: vodConfigId,
46 };
47 const [operation] = await stitcherClient.createVodConfig(request);
48 const [response] = await operation.promise();
49 console.log(`response.name: ${response.name}`);
50 }
51
52 createVodConfig().catch(err => {
53 console.error(err.message);
54 process.exitCode = 1;
55 });
56 // [END videostitcher_create_vod_config]
57}
58
59// node createVodConfig.js <projectId> <location> <vodConfigId> <sourceUri> <adTagUri>
60main(...process.argv.slice(2));

Callers 1

createVodConfig.jsFile · 0.70

Calls 1

createVodConfigFunction · 0.85

Tested by

no test coverage detected