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

Function main

media/video-stitcher/updateSlate.js:18–57  ·  view source on GitHub ↗
(projectId, location, slateId, slateUri)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, slateId, slateUri) {
19 // [START videostitcher_update_slate]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // slateId = 'my-slate';
26 // slateUri = 'https://my-slate-uri/test.mp4';
27
28 // Imports the Video Stitcher library
29 const {VideoStitcherServiceClient} =
30 require('@google-cloud/video-stitcher').v1;
31 // Instantiates a client
32 const stitcherClient = new VideoStitcherServiceClient();
33
34 async function updateSlate() {
35 // Construct request
36 const request = {
37 slate: {
38 name: stitcherClient.slatePath(projectId, location, slateId),
39 uri: slateUri,
40 },
41 updateMask: {
42 paths: ['uri'],
43 },
44 };
45
46 const [operation] = await stitcherClient.updateSlate(request);
47 const [response] = await operation.promise();
48 console.log(`Updated slate: ${response.name}`);
49 console.log(`Updated uri: ${response.uri}`);
50 }
51
52 updateSlate().catch(err => {
53 console.error(err.message);
54 process.exitCode = 1;
55 });
56 // [END videostitcher_update_slate]
57}
58
59// node updateSlate.js <projectId> <location> <slateId> <slateUri>
60main(...process.argv.slice(2));

Callers 1

updateSlate.jsFile · 0.70

Calls 1

updateSlateFunction · 0.85

Tested by

no test coverage detected