WebRTC consists of several interrelated APIs and protocols which work together to support the exchange of data and media between two or more peers. This article provides a brief overview of each of these APIs and what purpose it serves.
This article introduces the protocols on top of which the WebRTC API is built.
The LocalMediaStream interface represents a stream of media content fetched from a local data source. This is the interface returned by getUserMedia().
The MediaStream interface represents a stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack.
The MediaStream.getTrackById() method returns a MediaStreamTrack object representing the track with the specified ID string. If there is no track with the specified ID, this method returns null.
The MediaStreamTrack.enabled property returns a Boolean with a value of true if the track is enabled, that is allowed to render the media source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. If the track has been disconnected, this value can be changed but has no effect.
The MediaStreamTrack.onunmute event handler is a property called when the unmute event is received. Such an event is sent when the track is again able to send data.
The MediaStreamTrack.stop() method stops playing the source associated with the track. Both the source and the track are deassociated. The track state is set to ended.
The interface of the the WebRTC API provides an object represents a certificate that an RTCPeerConnection uses to authenticate.