@@ -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
@@ -1591,19 +1598,12 @@ Constructors</h4>
15911598 {{AudioSinkOptions/type}} in |sinkId| and {{AudioSinkInfo/type}}
15921599 in {{AudioContext/[[sink ID]]}} are equal, abort these substeps.
15931600
1594- 1. Let |validationResult| be the return value of
1595- <a href="#validating-sink-identifier">sink identifier validation
1596- </a> of |sinkId|.
1597-
1598- 1. If |validationResult| is a type of {{DOMException}}, throw an
1599- exception with |validationResult| and abort these substeps.
1600-
16011601 1. If |sinkId| is a type of {{DOMString}}, set
1602- {{AudioContext/[[sink ID]]}} to |sinkId| and abort these
1602+ {{AudioContext/[[sink ID at construction ]]}} to |sinkId| and abort these
16031603 substeps.
16041604
16051605 1. If |sinkId| is a type of {{AudioSinkOptions}}, set
1606- {{AudioContext/[[sink ID]]}} to a new instance of
1606+ {{AudioContext/[[sink ID at construction ]]}} to a new instance of
16071607 {{AudioSinkInfo}} created with the value of
16081608 {{AudioSinkOptions/type}} of |sinkId|.
16091609
@@ -1640,23 +1640,30 @@ Constructors</h4>
16401640 Sending a <a>control message</a> to start processing means
16411641 executing the following steps:
16421642
1643- 1. Let |document| be the [=current settings object=]'s [=relevant global object=]'s
1644- [=associated Document=].
1643+ 1. Let |validationResult| be the return value of
1644+ <a href="#validating-sink-identifier">sink identifier validation
1645+ </a> of {{AudioContext/[[sink ID at construction]]}}.
1646+
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.
16451654
16461655 1. Attempt to [=acquire system resources=] to use a following audio output device
1647- based on {{AudioContext/[[sink ID]]}} for rendering:
1656+ based on {{AudioContext/[[sink ID at construction ]]}} for rendering:
16481657
16491658 * The default audio output device for the empty string.
1650- * A audio output device identified by {{AudioContext/[[sink ID]]}}.
1651-
1652- 1. If resource acquisition fails, execute the following steps:
1653-
1654- 1. If |document| is not allowed to use the feature identified by
1655- <code>"speaker-selection"</code>, abort these substeps.
1659+ * An audio output device identified by {{AudioContext/[[sink ID at construction]]}}.
16561660
1657- 1. [=Queue a media element task=] to [=fire an event=] named
1658- {{AudioContext/error}} at the {{AudioContext}}, and abort the following
1659- steps.
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.
1665+
1666+ 1. Set {{AudioContext/[[sink ID]]}} to the value of {{AudioContext/[[sink ID at construction]]}}.
16601667
16611668 1. Set [=this=] {{[[rendering thread state]]}} to <code>running</code> on the
16621669 {{AudioContext}}.
@@ -2171,9 +2178,10 @@ Methods</h4>
21712178 1. Let |validationResult| be the return value of
21722179 <a href="#validating-sink-identifier">sink identifier validation</a>
21732180 of |sinkId|.
2174-
2175- 1. If |validationResult| is not <code>null</code>, return a promise
2176- rejected with |validationResult|. Abort these steps.
2181+
2182+ 1. If |validationResult| is <code>false</code>, return a promise
2183+ rejected with a new {{DOMException}} whose name is
2184+ "{{NotAllowedError}}". Abort these steps.
21772185
21782186 1. Let |p| be a new promise.
21792187
@@ -2292,15 +2300,14 @@ This algorithm is used to validate the information provided to modify
22922300 1. Let |sinkIdArg| be the value passed in to this algorithm.
22932301
22942302 1. If |document| is not allowed to use the feature identified by
2295- <code>"speaker-selection"</code>, return a new {{DOMException}} whose name
2296- is "{{NotAllowedError}}".
2303+ <code>"speaker-selection"</code>, return <code>false</code>.
22972304
22982305 1. If |sinkIdArg| is a type of {{DOMString}} but it is not equal to the empty
22992306 string or it does not match any audio output device identified by the
23002307 result that would be provided by {{MediaDevices/enumerateDevices()}},
2301- return a new {{DOMException}} whose name is "{{NotFoundError}}" .
2308+ return <code>false</code> .
23022309
2303- 1. Return <code>null </code>.
2310+ 1. Return <code>true </code>.
23042311</div>
23052312
23062313<h4 dictionary id="AudioContextOptions">
0 commit comments