Reputation: 1110
what am i doing wrong below for the Type Error? and how should i write the video stream to endpoint in the below code:
I have the below code
successCallback(stream){
AWS.config.region = 'us-east-1'; // Region
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'xxxxxxxxxxx',
});
AWS.config.apiVersions = {
kinesisvideo:'2017-09-30'
}
var kinesisvideo = new AWS.KinesisVideo();
//Get stream
var params = {
APIName: "PUT_MEDIA",
StreamName: this.KINESIS_STREAM_NAME
};
kinesisvideo.getDataEndpoint(params,function(err,data){
if(err)
console.log(err,err.stack);
else{
console.log("Kinesis Stream Response ---------");
console.log(data);
// data.DataEndpoint
//How should i send the stream to endpoint?
}
});
}
I am getting an error
TypeError AWS.KinesisVideo is not a constructor
at
var kinesisvideo = new AWS.KinesisVideo();
Also, once i get the video stream end point, how should i write my data to the endpoint? There is no documentation provided on the same in aws docs.
Thanks.
Upvotes: 1
Views: 531
Reputation: 31
As per your description, I think you are using default JavaScript SDK provided which does not contain kinesis video.
You can override this default and easily build your own custom version of the SDK: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/browser-building.html
Upvotes: 2