sendStreamMessage abstract method
Sends a data stream.
After calling createDataStream, you can call this method to send data stream messages to all users in the channel. The SDK imposes the following restrictions on this method: Each client in the channel can have up to 5 data channels simultaneously, with a total sending bitrate limit of 30 KB/s shared among all channels. Each data channel can send up to 60 packets per second, with each packet limited to 1 KB. After this method is successfully called, the remote side triggers the onStreamMessage callback, through which remote users can receive the stream message. If the call fails, the remote side triggers the onStreamMessageError callback. If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and state synchronization, we recommend using Real-time Messaging. This method must be called after joining the channel and after calling createDataStream to create the data channel. This method is only applicable to broadcaster users.
streamIdThe data stream ID. You can get it through createDataStream.dataThe data to be sent.lengthThe length of the data.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> sendStreamMessage(
{required int streamId, required Uint8List data, required int length});