private void RegisterDataChannelCreatedCallback() { _webRtcDataChannelCreatedCallback = (handle, dataChannelHandle, _) => { Log.Debug(WebRTCLog.Tag, "Invoked"); DataChannel?.Invoke(this, new WebRTCDataChannelEventArgs(dataChannelHandle)); }; NativeDataChannel.SetCreatedByPeerCb(Handle, _webRtcDataChannelCreatedCallback). ThrowIfFailed("Failed to set data channel created callback."); }
/// <summary> /// 新的数据通道打开了 /// </summary> /// <param name="channel">新的数据通道</param> internal void emitDataChannel(RTCDataChannel channel) { DataChannel?.Invoke(channel); }