private void OnRemoteStreamRemoved(Org.WebRtc.Media media, Org.WebRtc.MediaVideoTrack peerVideoTrack) { Messenger.Broadcast(SympleLog.LogDebug, "OnRemoteStreamRemoved"); RunOnUiThread(async() => { Messenger.Broadcast(SympleLog.LogInfo, "Removing video track media element pair"); media.RemoveVideoTrackMediaElementPair(peerVideoTrack); }); }
private void OnRemoteStreamAdded(Org.WebRtc.Media media, Org.WebRtc.MediaVideoTrack peerVideoTrack) { Messenger.Broadcast(SympleLog.LogDebug, "OnRemoteStreamAdded"); RunOnUiThread(async() => { Messenger.Broadcast(SympleLog.LogInfo, "Adding video track media element pair"); media.AddVideoTrackMediaElementPair(peerVideoTrack, RemoteVideo, SymplePlayerEngineWebRTC.RemotePeerVideoTrackId); Messenger.Broadcast(SympleLog.LogInfo, "Done adding video track media element pair"); //MediaSource createdSource = MediaSource.CreateFromIMediaSource(source); //_mediaPlayer.Source = createdSource; //_mediaPlayer.Play(); }); }
public void EnsureRtcIsInitialized() { lock (_lock) { if (!_rtcIsInitialized) { // On Windows 10, we don't need to use the CoreDispatcher. // Pass null to initialize. WebRTC.Initialize(null); // Cache the media object for later use. Media = WebRTCMedia.CreateMedia(); _rtcIsInitialized = true; Media.OnMediaDevicesChanged += OnMediaDevicesChanged; WebRTCMedia.SetDisplayOrientation(_displayOrientation); // Uncomment the following line to enable WebRTC logging. // Logs are: // - Saved to local storage. Log folder location can be obtained using WebRTC.LogFolder() // - Sent over network if client is connected to TCP port 47003 //WebRTC.EnableLogging(LogLevel.LOGLVL_INFO); } } }
public IAsyncAction ReleaseDevicesAsync() { RtcManager.Instance.EnsureRtcIsInitialized(); WebRTCMedia.OnAppSuspending(); return(Task.CompletedTask.AsAsyncAction()); }