(projectId, location, vodConfigId)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, vodConfigId) { |
| 19 | // [START videostitcher_create_vod_session] |
| 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 | |
| 27 | // Imports the Video Stitcher library |
| 28 | const {VideoStitcherServiceClient} = |
| 29 | require('@google-cloud/video-stitcher').v1; |
| 30 | // Instantiates a client |
| 31 | const stitcherClient = new VideoStitcherServiceClient(); |
| 32 | |
| 33 | async function createVodSession() { |
| 34 | // Construct request |
| 35 | const request = { |
| 36 | parent: stitcherClient.locationPath(projectId, location), |
| 37 | vodSession: { |
| 38 | vodConfig: stitcherClient.vodConfigPath( |
| 39 | projectId, |
| 40 | location, |
| 41 | vodConfigId |
| 42 | ), |
| 43 | adTracking: 'SERVER', |
| 44 | }, |
| 45 | }; |
| 46 | const [session] = await stitcherClient.createVodSession(request); |
| 47 | console.log(`VOD session: ${session.name}`); |
| 48 | } |
| 49 | |
| 50 | createVodSession().catch(err => { |
| 51 | console.error(err.message); |
| 52 | process.exitCode = 1; |
| 53 | }); |
| 54 | // [END videostitcher_create_vod_session] |
| 55 | } |
| 56 | |
| 57 | // node createVodSession.js <projectId> <location> <vodConfigId> |
| 58 | main(...process.argv.slice(2)); |
no test coverage detected