(projectId, location, slateId, slateUri)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, slateId, slateUri) { |
| 19 | // [START videostitcher_create_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 createSlate() { |
| 35 | // Construct request |
| 36 | const request = { |
| 37 | parent: stitcherClient.locationPath(projectId, location), |
| 38 | slate: { |
| 39 | uri: slateUri, |
| 40 | }, |
| 41 | slateId: slateId, |
| 42 | }; |
| 43 | const [operation] = await stitcherClient.createSlate(request); |
| 44 | const [response] = await operation.promise(); |
| 45 | console.log(`response.name: ${response.name}`); |
| 46 | } |
| 47 | |
| 48 | createSlate().catch(err => { |
| 49 | console.error(err.message); |
| 50 | process.exitCode = 1; |
| 51 | }); |
| 52 | // [END videostitcher_create_slate] |
| 53 | } |
| 54 | |
| 55 | // node createSlate.js <projectId> <location> <slateId> <slateUri> |
| 56 | main(...process.argv.slice(2)); |
no test coverage detected