sendStreamMessage abstract method

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

Sends data stream messages.

Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method: Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 KB. Each client can send up to 6 KB of data per second. Each user can have up to five data streams simultaneously. 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. Ensure that you call createDataStream to create a data channel before calling this method. In live streaming scenarios, this method only applies to hosts.

  • 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});