'How can I play a WebRTC livestream from flutter?
my use case is a webrtc livestream is coming from AWS Kinesis, that I want to play in flutter app. I am new to WebRTC and AWS. And for flutter_webrtc lib, there is no proper documentation available.
Here is my sample response which comes from live video API (hiding few details in response):
{
"status": true,
"data": {
"shadowState": "Device Shadow updated successful!",
"channelARN": "arn:aws:kinesisvideo:us-west-2:",
"region": "us-west-2",
"clientId": "clientId",
"signalingChannelEndpoint": "wss://v-123.kinesisvideo.us-west-2.amazonaws.com",
"signedEndpointUrl": "wss://v-123.kinesisvideo.us-west-2.amazonaws.com/?...&X-Amz-SignedHeaders=host",
"iceServers": [
{
"urls": "stun:stun.kinesisvideo.us-west-2.amazonaws.com:443"
},
{
"urls": [
"turn:12-34-567-890.t-123.kinesisvideo.us-west-2.amazonaws.com:443?transport=udp",
"turns:12-34-567-890.t-123.kinesisvideo.us-west-2.amazonaws.com:443?transport=udp",
"turns:12-34-567-890.t-123.kinesisvideo.us-west-2.amazonaws.com:443?transport=tcp"
],
"username": "1....2:djE....UxODc1",
"credential": "2eg..NOc/1c..."
}
]
}
}
And there is no official lib from AWS for this, so I tried to use this lib aws_kinesis_video_signaling_api but again no proper documentation is there. Anyone please help me understand these things. Thank you
Solution 1:[1]
The flutter_webrtc takes in a configuration map something similar to the one mentioned.
Map<String, dynamic> configuration = {
"iceServers": [
{"url": "stun:stun.l.google.com:19302"},
]
};
You can add some offerSdpConstraints and pass this configuration to
RTCPeerConnection pc =
await createPeerConnection(configuration, offerSdpConstraints);
to connect to a remote peer. The documentation isn't very helpful but if you're looking for a guide on Flutter x WebRTC maybe check this article out.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Aditya Thakur |
