public VoipContext(IHub hub, CoreDispatcher dispatcher, Func<IVideoRenderHelper> renderResolver, IVoipCoordinator coordinator) { _hub = hub; _dispatcher = dispatcher; _renderResolver = renderResolver; _localSettings = ApplicationData.Current.LocalSettings; VoipCoordinator = coordinator; var idleState = new VoipState_Idle(); SwitchState(idleState).Wait(); ResetRenderers(); }
public override async Task OnEnteringState() { Context.SendToPeer(RelayMessageTags.VoipHangup, ""); if (Context.PeerConnection != null) { Context.PeerConnection.Close(); Context.PeerConnection = null; Context.PeerId = null; } StopTracks(Context.LocalStream?.GetTracks()); Context.LocalStream?.Stop(); Context.LocalStream = null; StopTracks(Context.RemoteStream?.GetTracks()); Context.RemoteStream?.Stop(); Context.RemoteStream = null; Context.ResetRenderers(); var idleState = new VoipState_Idle(); await Context.SwitchState(idleState); }