You've learned how to handle local media. In this tutorial, you will learn how to handle remote media to capture a remote user's audio and video.
Note
For web, we don't implement remote media because LiveSwitch provides one that works with the major browsers.
Prerequisites
This tutorial requires the Local Media app you have created earlier.
Create Remote Media
Step1. Define Remote Media: Similar to a user's local media, we implement other participants' remote media by extending the RtcRemoteMedia<T> class. The generic type T represents the type of object is used for displaying the video preview of these remote participants. We will create a class named RemoteMedia in a separate file.
Step2.Enable AEC in Remote Media: We've already implemented AEC when we created the local media. We now need to enable it in our remote media so that the remote user's echo can be removed for the local user.
Step3. Play Remote Audio: To play audio from a remote video feed, we implement the following:
The CreateAudioRecorder method that records a user's audio.
The CreateAudioSink method that returns an audio sink for audio playback.
The CreateOpusDecoder method that decodes Opus encoder.
Step4. Play Remote Video: To play remote video, we implement the following:
The CreateVideoRecorder method that records a user's video.
The CreateViewSink method that creates a view object to playback a remote video feed.
The CreateVp8Decoder, CreateVp9Decoder, and CreateH264Decoder methods that decode the VP8, VP9, and H.264 encoders.
The CreateImageConverter method that provides a minor image formatting utility.
Congratulations, you've built a LiveSwitch app to handle remote media!
Deprecation Notice
On June 30, 2022, UWP, tvOS, watchOS, Java Desktop, non-Safari browsers on iOS, and .NET STUN/TURN Server Example will be deprecated.
If you need support to maintain applications on one of these platforms, contact Sales.