publishData method

Future<void> publishData(
  1. List<int> data,
  2. {Reliability reliability = Reliability.reliable,
  3. List<String>? destinationSids,
  4. String? topic}
)

Publish a new data payload to the room. @param destinationSids When empty, data will be forwarded to each participant in the room. @param topic, the topic under which the message gets published.

Implementation

Future<void> publishData(
  List<int> data, {
  Reliability reliability = Reliability.reliable,
  List<String>? destinationSids,
  String? topic,
}) async {
  final packet = lk_models.DataPacket(
    kind: reliability.toPBType(),
    user: lk_models.UserPacket(
      payload: data,
      participantSid: sid,
      destinationSids: destinationSids,
      topic: topic,
    ),
  );

  await room.engine.sendDataPacket(packet);
}