Skip to content

Commit

Permalink
Change publishData signature. (#436)
Browse files Browse the repository at this point in the history
* Change publishData signature.

* update.

* update.
  • Loading branch information
cloudwebrtc authored Jan 8, 2024
1 parent 76ac115 commit dcffb22
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/src/participant/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,20 +400,23 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
}

/// Publish a new data payload to the room.
/// @param destinationSids When empty, data will be forwarded to each participant in the room.
/// @param reliable, when true, data will be sent reliably.
/// @param destinationIdentities When empty, data will be forwarded to each participant in the room.
/// @param topic, the topic under which the message gets published.
Future<void> publishData(
List<int> data, {
Reliability reliability = Reliability.reliable,
List<String>? destinationSids,
bool? reliable,
List<String>? destinationIdentities,
String? topic,
}) async {
final packet = lk_models.DataPacket(
kind: reliability.toPBType(),
kind: reliable == true
? lk_models.DataPacket_Kind.RELIABLE
: lk_models.DataPacket_Kind.LOSSY,
user: lk_models.UserPacket(
payload: data,
participantSid: sid,
destinationSids: destinationSids,
participantIdentity: identity,
destinationIdentities: destinationIdentities,
topic: topic,
),
);
Expand Down

0 comments on commit dcffb22

Please sign in to comment.