sendSocketMessage static method

Future<void> sendSocketMessage({
  1. required Room? room,
  2. String? message,
  3. String? type,
  4. String? status,
  5. String? timeEnd,
  6. int? size,
})

Implementation

static Future<void> sendSocketMessage({
  required Room? room,
  String? message,
  String? type,
  String? status,
  String? timeEnd,
  int? size,
}) async {
  try {
    final messageJson = json.encode({
      "type": type ?? "text",
      "size": size,
      "status": status,
      "message": message,
      "time_end": timeEnd,
      "callId": callId,
    });
    showLogL(messageJson);
    await room?.localParticipant?.publishData(utf8.encode(messageJson));
  } catch (e) {
    showLogE(e.toString(), className: "sendSocketMessage");
  }
}