@rtcstats/rtcstats-js 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/media.js +3 -0
- package/package.json +1 -1
- package/peerconnection.js +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@ This is part of the [monorepo](https://github.com/rtcstats/rtcstats) for rtcstat
|
|
|
3
3
|
dump-importer (supporting rtcstats and webrtc-internals formats).
|
|
4
4
|
|
|
5
5
|
It is part of a bigger offering that includes [rtcstats.com](https://rtcstats.com),
|
|
6
|
-
|
|
6
|
+
the hosted WebRTC observability service that reads collected dumps and returns Observations,
|
|
7
|
+
an Experience Score, and a plain-English AI summary of what went wrong on the call.
|
|
7
8
|
|
|
8
9
|
For a complete reference of every getStats() metric rtcstats collects and analyzes, see
|
|
9
10
|
the [WebRTC Stats Reference](https://rtcstats.com/kb/webrtc-stats-reference-page).
|
package/media.js
CHANGED
|
@@ -13,6 +13,9 @@ import {compressMethod, dumpTrackWithStreams} from '@rtcstats/rtcstats-shared';
|
|
|
13
13
|
function wrapTrackProperty(track, property, trace) {
|
|
14
14
|
const prop = Object.getOwnPropertyDescriptor(
|
|
15
15
|
MediaStreamTrack.prototype, property);
|
|
16
|
+
if (!prop || !prop.get || !prop.set) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
16
19
|
|
|
17
20
|
// Replace the property with a custom one
|
|
18
21
|
Object.defineProperty(track, property, {
|
package/package.json
CHANGED
package/peerconnection.js
CHANGED
|
@@ -153,7 +153,7 @@ export function wrapRTCPeerConnection(trace, window, {getStatsInterval}) {
|
|
|
153
153
|
e.transceiver.sender.__rtcStatsId = pcId;
|
|
154
154
|
e.transceiver.sender.__rtcStatsSenderId = e.track.id;
|
|
155
155
|
}
|
|
156
|
-
if (e.track.kind === 'video') {
|
|
156
|
+
if (e.track.kind === 'video' && typeof document !== 'undefined' && document.querySelectorAll) {
|
|
157
157
|
setTimeout(() => {
|
|
158
158
|
document.querySelectorAll('video').forEach(el => {
|
|
159
159
|
if (!el.srcObject) return;
|
|
@@ -188,7 +188,7 @@ export function wrapRTCPeerConnection(trace, window, {getStatsInterval}) {
|
|
|
188
188
|
let statsInterval;
|
|
189
189
|
const statsIdMap = {};
|
|
190
190
|
const getStats = async (reason) => {
|
|
191
|
-
if (pc.signalingState === 'closed') {
|
|
191
|
+
if (pc.signalingState === 'closed' || pc.connectionState === 'closed') {
|
|
192
192
|
if (statsInterval) {
|
|
193
193
|
window.clearInterval(statsInterval);
|
|
194
194
|
}
|