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.