Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
Migración de aws-sdk js v2 a v3 Problemas con getHLSStreamingSessionURLCommand

Estoy tratando de migrar el código de la v2 a la v3 pero tengo problemas para encontrar cómo migrar esta línea:

 kinesisVideoArchivedContent.endpoint = new AWS.Endpoint(DataEndpoint)

el código anterior crea un punto final obj con algunas propiedades para usar en getHLSStreamingSessionURL:

 /*First you have to get de data endpoint calling getDataEndpoint*/ export const getEndPoint = (streamNme) => { return new Promise((resolve, reject) => { kinesisVideo.getDataEndpoint({ StreamName: streamName, APIName: "GET_HLS_STREAMING_SESSION_URL" }, function (err, response) { if ( err ) { return console.error(err); } // console.log('Data endpoint: ' + response.DataEndpoint); resolve(response.DataEndpoint) }); }) export const getStream = (StreamName, DataEndpoint) => { return new Promise((resolve, reject) => { kinesisVideoArchivedContent.endpoint = new AWS.Endpoint(DataEndpoint) const PlaybackMode = 'LIVE' const FragmentSelectorType = 'SERVER_TIMESTAMP' const SESSION_EXPIRATION_SECONDS = 60 * 60 const params = { StreamName, PlaybackMode, HLSFragmentSelector: { FragmentSelectorType, }, Expires: parseInt(SESSION_EXPIRATION_SECONDS), } kinesisVideoArchivedContent.getHLSStreamingSessionURL(params, (err, response) => { if (err) { reject(StreamName) return } resolve(response.HLSStreamingSessionURL) }) }) }

Para la versión 3 La documentación oficial: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kinesis-video-archived-media/classes/gethlsstreamingsessionurlcommand.html

 import { KinesisVideoArchivedMediaClient, GetHLSStreamingSessionURLCommand } from "@aws-sdk/client-kinesis-video-archived-media"; // ES Modules import /*before the code below you have to call getDataEndpointCommand */ const client = new KinesisVideoArchivedMediaClient(config); const command = new GetHLSStreamingSessionURLCommand(input); const response = await client.send(command);

Este código de la versión 3 parece funcionar bien y devuelve un 200 con un obj con dos propiedades @mediadata y HLSStreamingSessionURL con undefined, siempre devuelve undefined porque creo que falta esta línea para v3:

 kinesisVideoArchivedContent.endpoint = new AWS.Endpoint(DataEndpoint)

Gracias de antemano

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!