To download the Kinesis Video Streams WebRTC SDK in Android, run the following command:
git clone https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-android.git
Setup user pool for secure login using Cognito:
Manage User Pools
Create a user pool
Pool name
Review defaults
Create user pool
Pool Id
App clients
in the left navigation.Add an app client
App client name
Create app client
Show details
and copy App client id
and App client secret
Manage Identity Pools
Create new identity pool
Identity pool name
Authentication providers
, in the Cognito
tab, fill-in the User Pool Id
and App client id
from the user pools step.Create Pool
authenticated identities
and click Edit
next to the policy document and your policy should look like this after editing: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cognito-identity:*",
"kinesisvideo:*"
],
"Resource": [
"*"
]
}
]
}
Allow
Identity Pool Id
from the code snippets on the screen.Open an existing Android Studio project
.{
"Version": "1.0",
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "us-west-2:01234567-89ab-cdef-0123-456789abcdef",
"Region": "us-west-2"
}
}
},
"IdentityManager": {
"Default": {}
},
"CognitoUserPool": {
"Default": {
"AppClientSecret": "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmno",
"AppClientId": "0123456789abcdefghijklmnop",
"PoolId": "us-west-2_qRsTuVwXy",
"Region": "us-west-2"
}
}
}
On your Android device, open AWSKinesisVideoWebRTCDemoApp and sign up with Create New Account
or sign in with existing accounts.
Note: This account information is stored in your Cognito User Pool and is not your AWS Console user name/password.
Once login is successful, you will entering the following channel information to start peer to peer streaming.
demo-channel
us-west-2
audio
if you would like to send both audio or video data.viewer
mode, you can enter a unique Client Id
. Client ID is required only if multiple viewers are connected to a channel. This helps channel's master identify respective viewers.To verify peer to peer streaming, do any of the following setup. In these setup, ensure that the signaling channel name, region, viewer ID, and the AWS account ID are the same.
master
mode for starting a new session. Remote peer will be joining as viewer to this master. There should be only one master for any given channel.master
) in viewer
mode; this will connect to an existing session (channel) where a master is connected.master
mode on a camera device.viewer
mode - you should be able to check the video (and audio if selected both in embedded SDK) showing up in the Android device from the camera.master
mode for starting a new session.viewer
.This library is licensed under the Apache 2.0 License.