private void PeerConnection_OnTrack(IRTCTrackEvent Event) { if (Event.Track.Kind == "video") { _peerVideoTrack = Event.Track; if (_peerVideoTrack != null) { _peerVideoTrack.Element = MediaElementMaker.Bind(Devices.Instance.PeerVideo); ((MediaStreamTrack)_peerVideoTrack).OnFrameRateChanged += (float frameRate) => { FramesPerSecondChanged?.Invoke("PEER", frameRate.ToString("0.0")); }; ((MediaStreamTrack)_peerVideoTrack).OnResolutionChanged += (uint width, uint height) => { ResolutionChanged?.Invoke("PEER", width, height); }; } } else if (Event.Track.Kind == "audio") { _peerAudioTrack = Event.Track; } OnAddRemoteTrack?.Invoke(Event.Track); }
private void PeerConnection_OnAddTrack(RTCTrackEvent evt) { OnAddRemoteTrack?.Invoke(evt); }