PeerRepairMonitor

Source: PeerRepairMonitor.js:77

Decides, from the stats of one RTCPeerConnection, whether the selected ICE candidate pair is unusable and whether another pair is a realistic alternative. The decision is returned to the caller, which performs the repair; this class never touches the peer.


Constructor

new PeerRepairMonitor(options): PeerRepairMonitor

Instance Methods

reset()

Clears the per-peer counters. Call when a new peer starts being monitored.

clearDemotions()

Forgets the candidates demoted so far. Call before a full reconnect so all candidates get a new chance.

onRepairFailed()

The current connection is kept, so monitoring of it continues.

evaluate( stats: Object, streamActive: Boolean, nowMs?: Number, ): Object | null

Parameters

  • stats (Object) — Parsed stats from PeerConnectionStats (uses raw, audio.inbounds, video.inbounds).
  • streamActive (Boolean) — Whether the server reports the stream as active, so media is expected.
  • nowMs (Number, optional)

Returns

  • Object | null — Repair decision, or null when no repair should happen.