Skip to content

Commit 27add2c

Browse files
Michael Wilsonhoch
authored andcommitted
Use private slot for constructor sink ID
1 parent fbbb2e7 commit 27add2c

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

index.bs

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,13 @@ and to allow it only when the {{AudioContext}}'s [=relevant global object=] has
15221522
initial value is <code>""</code>, which means the default audio output
15231523
device.
15241524

1525+
: <dfn>[[sink ID at construction]]</dfn>
1526+
::
1527+
A {{DOMString}} or an {{AudioSinkInfo}} representing the identifier
1528+
or the information of the audio output device requested at construction,
1529+
respectively. The initial value is <code>""</code>, which means the
1530+
default audio output device.
1531+
15251532
: <dfn>[[pending resume promises]]</dfn>
15261533
::
15271534
An ordered list to store pending {{Promise}}s created by
@@ -1592,11 +1599,11 @@ Constructors</h4>
15921599
in {{AudioContext/[[sink ID]]}} are equal, abort these substeps.
15931600

15941601
1. If |sinkId| is a type of {{DOMString}}, set
1595-
{{AudioContext/[[sink ID]]}} to |sinkId| and abort these
1602+
{{AudioContext/[[sink ID at construction]]}} to |sinkId| and abort these
15961603
substeps.
15971604

15981605
1. If |sinkId| is a type of {{AudioSinkOptions}}, set
1599-
{{AudioContext/[[sink ID]]}} to a new instance of
1606+
{{AudioContext/[[sink ID at construction]]}} to a new instance of
16001607
{{AudioSinkInfo}} created with the value of
16011608
{{AudioSinkOptions/type}} of |sinkId|.
16021609

@@ -1633,31 +1640,30 @@ Constructors</h4>
16331640
Sending a <a>control message</a> to start processing means
16341641
executing the following steps:
16351642

1636-
1. Let |document| be the [=current settings object=]'s [=relevant global object=]'s
1637-
[=associated Document=].
1638-
16391643
1. Let |validationResult| be the return value of
16401644
<a href="#validating-sink-identifier">sink identifier validation
1641-
</a> of {{AudioContext/[[sink ID]]}}.
1645+
</a> of {{AudioContext/[[sink ID at construction]]}}.
16421646

1643-
1. If |validationResult| is <code>false</code>, [=queue a
1644-
media element task=] to [=fire an event=] named {{AudioContext/error}}
1645-
at the {{AudioContext}}, and abort the following steps.
1647+
1. If |validationResult| is <code>false</code>, execute the following steps:
1648+
1649+
1. Set {{AudioContext/[[sink ID]]}} to the empty string.
1650+
1651+
1. [=Queue a media element task=] to [=fire an event=]
1652+
named {{AudioContext/error}} at the {{AudioContext}},
1653+
and abort the following steps.
16461654

16471655
1. Attempt to [=acquire system resources=] to use a following audio output device
1648-
based on {{AudioContext/[[sink ID]]}} for rendering:
1656+
based on {{AudioContext/[[sink ID at construction]]}} for rendering:
16491657

16501658
* The default audio output device for the empty string.
1651-
* An audio output device identified by {{AudioContext/[[sink ID]]}}.
1652-
1653-
1. If resource acquisition fails, execute the following steps:
1659+
* An audio output device identified by {{AudioContext/[[sink ID at construction]]}}.
16541660

1655-
1. If |document| is not allowed to use the feature identified by
1656-
<code>"speaker-selection"</code>, abort these substeps.
1661+
1. If resource acquisition fails, [=queue a media element
1662+
task=] to [=fire an event=] named
1663+
{{AudioContext/error}} at the {{AudioContext}}, and
1664+
abort the following steps.
16571665

1658-
1. [=Queue a media element task=] to [=fire an event=] named
1659-
{{AudioContext/error}} at the {{AudioContext}}, and abort the following
1660-
steps.
1666+
1. Set {{AudioContext/[[sink ID]]}} to the value of {{AudioContext/[[sink ID at construction]]}}.
16611667

16621668
1. Set [=this=] {{[[rendering thread state]]}} to <code>running</code> on the
16631669
{{AudioContext}}.

0 commit comments

Comments
 (0)