commandReceivedStream method

Stream<ZegoSignalingPluginInRoomCommandMessageReceivedEvent> commandReceivedStream()

room command stream notify

If you have a string encoded in UTF-8 and want to convert a Uint8List to that string, you can use the following method:

import 'dart:convert'; import 'dart:typed_data';

Uint8List dataBytes = Uint8List.fromList(utf8.encode(commandString));

Implementation

Stream<ZegoSignalingPluginInRoomCommandMessageReceivedEvent>
    commandReceivedStream() {
  if (null == ZegoUIKit().getPlugin(ZegoUIKitPluginType.signaling)) {
    ZegoLoggerService.logInfo(
      'commandReceivedStream, signaling is null',
      tag: 'audio room',
      subTag: 'controller.room',
    );

    return const Stream.empty();
  }

  return ZegoUIKit()
      .getSignalingPlugin()
      .getInRoomCommandMessageReceivedEventStream();
}