Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 77 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Copy link
Collaborator Author

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

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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down