listenEvents method

void listenEvents(
  1. WaterbusWebRTCManager rtcManager
)

Implementation

void listenEvents(WaterbusWebRTCManager rtcManager) {
  if (!WebRTC.platformIsIOS) return;

  rkChannel.setMethodCallHandler((call) async {
    if (call.method == "closeReplayKitFromNative") {
      rtcManager.stopScreenSharing();
    } else if (call.method == "hasSampleBroadcast") {
      rtcManager.startScreenSharing();
    }
  });
}