2

I am trying to get live video stream from the Amazon KVS to show in a dashboard board that I am building using React. I am very new to this (Amazon KVS)ecosystem and have no idea about how things work hence asking you good folks here.

I tried referring the 'amazon-kinesis-video-streams-webrtc-sdk-js' on github but it does not explain clearly as to how can I fetch the live video stream from kvs. The following is the thing that I've tried and have no clear idea as to what should I do with the endpointsByProtocol next to get the stream. I am bit on the deadline as well, hope someone can help.

 var options = {
          accessKeyId: response?.access_key_id,
          secretAccessKey: response?.secret_access_key,
          region: response?.region,
          sessionToken: response?.session_token
        }
        const kinesisVideoClient = new AWS.KinesisVideo(options);
        const {ChannelInfo} = await kinesisVideoClient.describeSignalingChannel({
            ChannelName: channelName
          }).promise();
    
        const {ChannelARN, ChannelName} = ChannelInfo;
        const getSignalingChannelEndpointResponse = await kinesisVideoClient.getSignalingChannelEndpoint({
            ChannelARN: ChannelARN,
            SingleMasterChannelEndpointConfiguration: {
                Protocols: ['WSS', 'HTTPS'],
                Role: Role.VIEWER,
            },
        })
        .promise();
    const endpointsByProtocol = getSignalingChannelEndpointResponse.ResourceEndpointList.reduce((endpoints, endpoint) => {
        endpoints[endpoint.Protocol] = endpoint.ResourceEndpoint;
        return endpoints;
    }, {});

P.S: Apologies if this is something very basic and also thanks.

I tried referring the official doc of the AWS as well but it was not clear.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Kinesis Video Streams and Kinesis Video Streams with WebRTC are both for different use cases. Kinesis Video Stream is used to capture live streams. Kinesis WebRTC follows the WebRTC specification to help users to have 2 way audio video communication. If you just want to play the video in dashboard try the below workshop link https://catalog.us-east-1.prod.workshops.aws/kinesis-video-streams/en-US/lab-1 – Vikram S Jan 24 '23 at 19:09

0 Answers0