public bool ReciveRemoteConnection(string machineId, SdpInfo remoteOfferInfo) { this.remoteMachine = MachineLogic.GetMachineById(machineId); this.InitlizeConnetion(); var answerInfo = this.PeerConnection.SetRemoteDescription(remoteOfferInfo.sdp, remoteOfferInfo.type).Result; if (answerInfo == null) { this.showInfo("流媒体设备启动失败"); return(false); } WebSocketClient.SendMessage(machineId, answerInfo, msgType.client_onCallee_CreateAnswer); return(true); }
public void ReciveRemoteConnection(string machineId, SdpInfo remoteOfferInfo) { if (this.CanConnect == true) { var newbeControlled = new RemoteBeingControlled(); newbeControlled.onCloseEvent += BeControlled_onCloseEvent; newbeControlled.ReciveRemoteConnection(machineId, remoteOfferInfo); //***************************************************** Application.Current.MainWindow.Close(); //****************************************************** this.beControlleds.Add(newbeControlled); this.beConWindow = new BeControllWindow(newbeControlled); this.closeNeedConfirm = true; this.beConWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; this.beConWindow.Show(); this.beConWindow.Closing += BeConWindow_Closing; } }
/// <summary> /// 主动连接对方成功,接受对方发来的answer /// </summary> /// <param name="mchineId"></param> /// <param name="offerinfo"></param> public void SetRemoteAnswer(string mchineId, SdpInfo remoteAnswer) { this.CurrentContext.SetRemoteAnswer(mchineId, remoteAnswer.sdp, remoteAnswer.type); }
/// <summary> /// 主动连接对方成功,接受对方发来的answer /// </summary> /// <param name="mchineId"></param> /// <param name="offerinfo"></param> public void SetRemoteAnswer(string mchineId, SdpInfo remoteAnswer) { this.controllerWindow.SetRemoteAnswer(mchineId, remoteAnswer); }
private void onCreateAnswerSuccessEvent(object sender, SdpInfo e) { }