0PricingLogin
Real-Time Streaming Systems (WebRTC + Live Data) · Lesson

Displaying Remote Audio/Video

Implement the logic to receive and display remote audio and video streams from connected peers in your application.

See and Hear Others

WebRTC enables direct communication, but how do we actually see and hear what a remote peer is sending?

  • We'll learn how to capture incoming audio/video data.
  • Then, how to display this data in your web application using standard HTML elements.
  • This is crucial for building video calls, live streaming, and more!

The 'ontrack' Event

When a remote peer sends a media stream, your RTCPeerConnection needs to know about it. This is handled by the ontrack event.

  • The ontrack event is triggered on your RTCPeerConnection object.
  • It fires when a new MediaStreamTrack (like an audio or video track) is received from the remote peer.
  • This event is your gateway to accessing the remote media.

All lessons in this course

  1. Accessing User Media Devices
  2. Adding and Removing Media Tracks
  3. Displaying Remote Audio/Video
  4. Controlling Media Quality and Constraints
← Back to Real-Time Streaming Systems (WebRTC + Live Data)