sendStreamMessage abstract method

Future<void> sendStreamMessage({
  1. required int streamId,
  2. required Uint8List data,
  3. required int length,
})

Sends data stream messages.

If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use. After calling createDataStream, you can call this method to send data stream messages to all users in the channel. The SDK has the following restrictions on this method: Each client within the channel can have up to 5 data channels simultaneously, with a total shared packet bitrate limit of 30 KB/s for all data channels. Each data channel can send up to 60 packets per second, with each packet being a maximum of 1 KB. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. A failed method call triggers the onStreamMessageError callback on the remote client. This method needs to be called after createDataStream and joining the channel. This method applies to broadcasters only.

  • streamId The data stream ID. You can get the data stream ID by calling createDataStream.
  • data The message to be sent.
  • length The 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.

Implementation

Future<void> sendStreamMessage(
    {required int streamId, required Uint8List data, required int length});