(projectId, location, vodConfigId, sourceUri)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, vodConfigId, sourceUri) { |
| 19 | // [START videostitcher_update_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 | |
| 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 updateVodConfig() { |
| 35 | // Construct request |
| 36 | const request = { |
| 37 | vodConfig: { |
| 38 | name: stitcherClient.vodConfigPath(projectId, location, vodConfigId), |
| 39 | sourceUri: sourceUri, |
| 40 | }, |
| 41 | updateMask: { |
| 42 | paths: ['sourceUri'], |
| 43 | }, |
| 44 | }; |
| 45 | |
| 46 | const [operation] = await stitcherClient.updateVodConfig(request); |
| 47 | const [response] = await operation.promise(); |
| 48 | console.log(`Updated VOD config: ${response.name}`); |
| 49 | console.log(`Updated sourceUri: ${response.sourceUri}`); |
| 50 | } |
| 51 | |
| 52 | updateVodConfig().catch(err => { |
| 53 | console.error(err.message); |
| 54 | process.exitCode = 1; |
| 55 | }); |
| 56 | // [END videostitcher_update_vod_config] |
| 57 | } |
| 58 | |
| 59 | // node updateVodConfig.js <projectId> <location> <vodConfigId> <sourceUri> |
| 60 | main(...process.argv.slice(2)); |
no test coverage detected