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

Function main

media/livestream/updateInput.js:18–59  ·  view source on GitHub ↗
(projectId, location, inputId)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, inputId) {
19 // [START livestream_update_input]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // inputId = 'my-input';
26
27 // Imports the Livestream library
28 const {LivestreamServiceClient} = require('@google-cloud/livestream').v1;
29
30 // Instantiates a client
31 const livestreamServiceClient = new LivestreamServiceClient();
32
33 async function updateInput() {
34 // Construct request
35 const request = {
36 input: {
37 name: livestreamServiceClient.inputPath(projectId, location, inputId),
38 preprocessingConfig: {
39 crop: {
40 topPixels: 5,
41 bottomPixels: 5,
42 },
43 },
44 },
45 updateMask: {
46 paths: ['preprocessing_config'],
47 },
48 };
49
50 // Run request
51 const [operation] = await livestreamServiceClient.updateInput(request);
52 const response = await operation.promise();
53 const [input] = response;
54 console.log(`Updated input: ${input.name}`);
55 }
56
57 updateInput();
58 // [END livestream_update_input]
59}
60
61// node updateInput.js <projectId> <location> <inputId>
62process.on('unhandledRejection', err => {

Callers 1

updateInput.jsFile · 0.70

Calls 1

updateInputFunction · 0.85

Tested by

no test coverage detected