getStats should be allowed on a closed PeerConnection

NEW
Unassigned

Status

()

P2
normal
Rank:
19
4 years ago
a month ago

People

(Reporter: jib, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Change getStats so that calling it on a closed PeerConnection does not throw, but instead makes available the stats at the time the PeerConnection closed.

Use-case: A webpage wants stats about the call that just terminated from the
other side - e.g. how many frames dropped?

Basically we already cache a final call to getStats internally for about:webrtc, so this bug is about returning this to content when getStats is called after close.
Rank: 35
Priority: -- → P3

Updated

4 years ago
backlog: --- → webRTC+
Mass change P3->P4 to align with new Mozilla triage process.
Priority: P3 → P4
We already take a snapshot of stats at time of close internally, for about:webrtc so this could be low-hanging fruit.
Rank: 35 → 19
Priority: P4 → P2
Duplicate of this bug: 1377225
Steps to reproduce:
1. Open https://jsfiddle.net/jib1/wmae5jtn/ and allow access
2. Click "Close!" button

Expected results:
 - Stats numbers should stop increasing, and fps which should go to 0.

Actual result:
 - TypeError: stats is null
You need to log in before you can comment on or make changes to this bug.