-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update WebRTC media source stats #32538
Conversation
Preview URLs (17 pages)
Flaws (7)Note! 10 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
URL:
URL:
URL:
URL:
URL:
(comment last updated: 2024-03-19 00:00:34) |
|
||
These statistics can be obtained by iterating the {{domxref("RTCStatsReport")}} returned by {{domxref("RTCRtpSender.getStats()")}} or {{domxref("RTCPeerConnection.getStats()")}} until you find a report with the [`type`](#type) of `media-source` and a [`kind`](#kind) of `audio`. | ||
|
||
> **Note:** For audio information about remotely sourced tracks (that are being received), see {{domxref("RTCInboundRtpStreamStats")}}. | ||
|
||
## Instance properties | ||
|
||
- {{domxref("RTCAudioSourceStats.audioLevel", "audioLevel")}} {{Experimental_Inline}} | ||
- {{domxref("RTCAudioSourceStats.audioLevel", "audioLevel")}} {{Experimental_Inline}}{{optional_inline}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ones that are not marked required
in the IDL have been marked as optional.
… mark optional audio source stats
c15eee3
to
6fa2a92
Compare
files/en-us/web/api/rtcvideosourcestats/framespersecond/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/rtcvideosourcestats/framespersecond/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/rtcvideosourcestats/framespersecond/index.md
Outdated
Show resolved
Hide resolved
@@ -7,27 +7,29 @@ browser-compat: api.RTCStatsReport.type_media-source | |||
|
|||
{{APIRef("WebRTC")}} | |||
|
|||
The [WebRTC API](/en-US/docs/Web/API/WebRTC_API)'s **`RTCAudioSourceStats`** dictionary provides information about an audio track that is attached to one or more senders. | |||
The **`RTCAudioSourceStats`** dictionary of the [WebRTC API](/en-US/docs/Web/API/WebRTC_API) provides statistics information about an audio track ({{domxref("MediaStreamTrack")}}) that is attached to one or more senders ({{domxref("RTCRtpSender")}}). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't comment on the line, but the spec URL is wrong for this, it is https://w3c.github.io/webrtc-stats/#dom-rtcstatstype-media-source but should be something like https://w3c.github.io/webrtc-stats/#dom-rtcaudiosourcestats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was because the media-source
"type" is shared by both audio and video objects, and this is how the items are sorted in BCD. I added a spec-urls
frontmatter for video and audio to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also need that for the individual members? And this looks like a systemic issue, e.g. https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionStats#specifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wbamberg Whlle it is "systemic" I am fairly sure we don't need to panic about this.
Taking RTCPeerConnectionStats
as an example, this links to https://w3c.github.io/webrtc-stats/#dom-rtcstatstype-peer-connection. This is the top level enum description for the type, which is used for searching. BUT, since all types except media-source
map 1:1 with a stats object, the text usefully explains a particular stats object and links direct to the object itself.
I don't think that needs to be fixed. But if you do, we could fix in the same way (I'd prefer not to mess with BCD because I think it would be harder).
The individual members should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree that setting spec-url is easier. I think it is wrong to link to the enum type but don't care much, since we don't AFAIK have particularly precise policies for what to link to in spec URLs.
This pull request has merge conflicts that must be resolved before it can be merged. |
Co-authored-by: Hamish Willee <[email protected]>
Co-authored-by: Hamish Willee <[email protected]>
Co-authored-by: wbamberg <[email protected]>
If I'm right :) I'd address it with something like:
|
Thanks very much. I must warn you, this is an "easy one" compared to the remote inbound stats :-0. There you have to get your head around who is reporting what. |
@@ -7,27 +7,29 @@ browser-compat: api.RTCStatsReport.type_media-source | |||
|
|||
{{APIRef("WebRTC")}} | |||
|
|||
The [WebRTC API](/en-US/docs/Web/API/WebRTC_API)'s **`RTCAudioSourceStats`** dictionary provides information about an audio track that is attached to one or more senders. | |||
The **`RTCAudioSourceStats`** dictionary of the [WebRTC API](/en-US/docs/Web/API/WebRTC_API) provides statistics information about an audio track ({{domxref("MediaStreamTrack")}}) that is attached to one or more senders ({{domxref("RTCRtpSender")}}). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also need that for the individual members? And this looks like a systemic issue, e.g. https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionStats#specifications
Co-authored-by: wbamberg <[email protected]>
Removing myself from review as Will's got it covered! 😉 |
Ready for you to review when ready @wbamberg - the systemic question, is addressed in #32538 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thank you Hamish!
This updates docs for
RTCAudioSourceStats
, and adds docs forRTCVideoSourceStats
- both of which aretype=media-source
objects you can get by iterating aRTCStatsReport
(differentiating via theirkind
property).This is part of the ongoing work to finished RTC stats, which was started in #27028
The changes to Audio source are mostly about API docs consistency.
This has an associated BCD update in mdn/browser-compat-data#22510