sendBinary method

Future<void> sendBinary(
  1. Uint8List binary
)

Implementation

Future<void> sendBinary(Uint8List binary) async {
  if (!open) {
    logger.error(
      "Connection is not open. You should listen for the `open` event before sending messages.",
    );
    super.emit(
      "error",
      Exception(
        "Connection is not open. You should listen for the `open` event before sending messages.",
      ),
    );
    return;
  }

  final message = RTCDataChannelMessage.fromBinary(binary);

  await dataChannel?.send(message);
}