Skip to content

Commit

Permalink
Merge pull request #1007 from jan-ivar/userinserted
Browse files Browse the repository at this point in the history
Add userInsertedDevices attribute to DeviceChangeEvent
  • Loading branch information
alvestrand authored Jun 20, 2024
2 parents cec8e2a + 898177b commit ce226f9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions getusermedia.html
Original file line number Diff line number Diff line change
Expand Up @@ -3412,6 +3412,7 @@ <h3>{{DeviceChangeEvent}}</h3>
interface DeviceChangeEvent : Event {
constructor(DOMString type, optional DeviceChangeEventInit eventInitDict = {});
[SameObject] readonly attribute FrozenArray&lt;MediaDeviceInfo&gt; devices;
[SameObject] readonly attribute FrozenArray&lt;MediaDeviceInfo&gt; userInsertedDevices;
};</pre>
<section>
<h2>Constructors</h2>
Expand Down Expand Up @@ -3439,6 +3440,38 @@ <h2>Attributes</h2>
objects representing the list of available devices at this time.
</p>
</dd>
<dt>
<dfn data-idl="">userInsertedDevices</dfn> of type <span class=
"idlAttrType">FrozenArray&lt;{{MediaDeviceInfo}}&gt;</span>,
readonly
</dt>
<dd>
<p>The {{userInsertedDevices}} attribute returns an array
containing only those {{MediaDeviceInfo}} objects from
{{devices}} that the user physically inserted or activated
recently and are newly exposed with this event as a result.
Otherwise, an empty list is returned.</p>
<p>The [=User Agent=] MAY include devices the
user inserted or activated before
{{MediaDevices/getUserMedia()}} was called, provided this
event marks their first exposure, and the user did not
choose devices in {{MediaDevices/getUserMedia()}}.
</p>
<p>The {{MediaDeviceInfo}} objects, if any, MUST also exist
in {{devices}}.</p>
<div class="note">
<p>A user inserting a device during (or immediately ahead of)
a call can be a strong signal that they wish to use the
device immediately.</p>
<p>Applications are encouraged to rely on this attribute
to disambiguate this signal from differences in {{devices}}
that might happen from changes in device information exposure.</p>
</div>
<div class="note">
If the attribute is missing, it means that this UA has not been upgraded to implement
this version of the specification.
</div>
</dd>
</dl>
</section>
</div>
Expand Down

0 comments on commit ce226f9

Please sign in to comment.