-
Notifications
You must be signed in to change notification settings - Fork 18
Add onssrcchange/oncsrcchange events to RTCRtpReceiver #243
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
Open
henbos
wants to merge
5
commits into
w3c:main
Choose a base branch
from
henbos:250926_onssrcchange
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−2
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1448,6 +1448,56 @@ <h2> | |
</section> | ||
</section> | ||
</section> | ||
<section id="source-change-event"> | ||
<h2> | ||
{{RTCRtpReceiver}} extensions | ||
</h2> | ||
<p> | ||
The {{RTCRtpReceiver}} interface and {{RTCRtpContributingSource}} and {{RTCRtpSynchronizationSource}} | ||
dictionaries are defined in [[WEBRTC]]. This document extends this interface by | ||
adding two event handlers that fire when the {{RTCRtpContributingSource/source}} of | ||
{{RTCRtpReceiver/getSynchronizationSources()}} or {{RTCRtpReceiver/getContributingSources()}} changes. | ||
</p> | ||
<p> | ||
By listening to these events, apps can react to source changes than if they were polling | ||
these APIs, enabling the UX to be updated more quickly in response to virtual SSRCs changing which is | ||
a common way for apps to keep track of which participant's media is currently being played out. | ||
</p> | ||
<pre class="idl">partial interface RTCRtpReceiver { | ||
attribute EventHandler onssrcchange; | ||
attribute EventHandler oncsrcchange; | ||
};</pre> | ||
<p> | ||
Whenever the {{RTCRtpContributingSource/source}} identifier is updated based on the last decoded frame, | ||
the [= user agent =] MUST [= queue a task =] to [= fire an event =] named {{RTCRtpReceiver/ssrcchange}} | ||
if the SSRC changed and an event named {{RTCRtpReceiver/csrcchange}} if the CSRC changed. If both | ||
identifiers are changed based on the same decoded frame, both events fire in the same queued task. This | ||
ensures that both SSRC and CSRC information is exposed to the app at the same time. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at the time of the first event |
||
</p> | ||
<h3> | ||
Attributes | ||
</h3> | ||
<dl data-link-for="RTCRtpReceiver" data-dfn-for="RTCRtpReceiver" class="attributes"> | ||
<dt> | ||
<dfn id="dom-rtptransceiver-onssrcchange">onssrcchange</dfn> of type {{EventHandler}} | ||
</dt> | ||
<dd> | ||
<p> | ||
Fired when the {{RTCRtpContributingSource/source}} in {{RTCRtpReceiver/getSynchronizationSources()}} | ||
changes, see above. | ||
</p> | ||
</dd> | ||
<dt> | ||
<dfn id="dom-rtptransceiver-oncsrcchange">oncsrcchange</dfn> of type {{EventHandler}} | ||
</dt> | ||
<dd> | ||
<p> | ||
Fired when the {{RTCRtpContributingSource/source}} in {{RTCRtpReceiver/getContributingSources()}} | ||
changes, see above. | ||
</p> | ||
</dd> | ||
</dl> | ||
</section> | ||
<section id="disable-hardware"> | ||
<h2>Disabling hardware acceleration</h2> | ||
<p> | ||
|
@@ -1526,8 +1576,7 @@ <h3>Modifications to existing procedures</h3> | |
</section> | ||
<section class="informative"> | ||
<h2>Event summary</h2> | ||
<p> | ||
The following events fire on {{RTCIceTransport}} objects:</p> | ||
<p>The following events fire on {{RTCIceTransport}} objects:</p> | ||
<table class="simple"> | ||
<thead> | ||
<tr> | ||
|
@@ -1561,6 +1610,32 @@ <h2>Event summary</h2> | |
</tr> | ||
</tbody> | ||
</table> | ||
<p>The following events fire on {{RTCRtpReceiver}} objects:</p> | ||
<table class="simple"> | ||
<thead> | ||
<tr> | ||
<th>Event name</th> | ||
<th>Interface</th> | ||
<th>Fired when...</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th scope=row><dfn data-dfn-for="RTCRtpReceiver" data-dfn-type=event>ssrcchange</dfn></th> | ||
<td>{{Event}}</td> | ||
<td> | ||
The SSRC identifier changed in response to an RTP packet. | ||
</td> | ||
</tr> | ||
<tr> | ||
<th scope=row><dfn data-dfn-for="RTCRtpReceiver" data-dfn-type=event>csrcchange</dfn></th> | ||
<td>{{Event}}</td> | ||
<td> | ||
The CSRC identifier changed in response to an RTP packet. | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</section> | ||
<section> | ||
<h2>Timestamp behavior</h2> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In the same queued task ... append the following steps at the end: 1. fire ssrcchange if changed, 2. fire csrcchange if changed