You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+64-35Lines changed: 64 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -1962,7 +1962,10 @@ Methods</h4>
1962
1962
<span class="synchronous">When resume is called,
1963
1963
execute these steps:</span>
1964
1964
1965
-
1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=fully active=] then return [=a promise rejected with=] "{{InvalidStateError}}" {{DOMException}}.
1965
+
1. If [=this=]'s [=relevant global object=]'s
1966
+
[=associated Document=] is not [=fully active=] then return
1. Set {{[[suspended by user]]}} to <code>false</code>.
1975
1978
1976
-
1. If the {{[[control thread state]]}} on the
1977
-
{{AudioContext}} is <code>suspended</code> and there is an ongoing [=interruption=]:
1979
+
1. If the {{[[control thread state]]}} on the {{AudioContext}} is
1980
+
<code>suspended</code> and there is an ongoing
1981
+
[=interruption=]:
1978
1982
1979
1983
1. Queue a media element task</a> to execute the following steps:
1980
1984
1981
-
1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}} to "{{AudioContextState/interrupted}}".
1985
+
1. Set the {{BaseAudioContext/state}} attribute of the
1986
+
{{AudioContext}} to "{{AudioContextState/interrupted}}".
1982
1987
1983
1988
1. [=Queue a media element task=] to [=fire an event=] named
1984
-
{{BaseAudioContext/statechange}} at the {{AudioContext}}.
1989
+
{{BaseAudioContext/statechange}} at the {{AudioContext}}.
1985
1990
1986
-
1. Reject the promise with {{InvalidStateError}}, abort these steps,
1987
-
returning <var>promise</var>.
1991
+
1. Reject the promise with {{InvalidStateError}}, abort these
1992
+
steps, returning <var>promise</var>.
1988
1993
1989
1994
1. If the context is not <a>allowed to start</a>, append
1990
-
<var>promise</var> to {{BaseAudioContext/[[pending promises]]}} and
1991
-
{{AudioContext/[[pending resume promises]]}} and abort these steps, returning
1992
-
<var>promise</var>.
1995
+
<var>promise</var> to {{BaseAudioContext/[[pending promises]]}}
1996
+
and {{AudioContext/[[pending resume promises]]}} and abort
1997
+
these steps, returning <var>promise</var>.
1993
1998
1994
-
1. Set the {{[[control thread state]]}} on the
1995
-
{{AudioContext}} to <code>running</code>.
1999
+
1. Set the {{[[control thread state]]}} on the {{AudioContext}} to
2000
+
<code>running</code>.
1996
2001
1997
2002
1. <a>Queue a control message</a> to resume the {{AudioContext}} with <var>promise</var>.
1998
2003
@@ -11966,66 +11971,90 @@ buffer</a> and the value(s) of the {{AudioParam}}(s) of this
11966
11971
11967
11972
<h3 id="interruption-handling">Handling an interruption on the {{AudioContext}}</h3>
11968
11973
11969
-
An <dfn>interruption</dfn> is an event generated by the user agent when it needs to halt audio playback for
11970
-
an {{AudioContext}}. For example, The user agent may create an interruption when another application
11971
-
requests exclusive access to the audio output hardware. This could happen when there is an incoming
11972
-
call from a VoIP application.
11974
+
An <dfn>interruption</dfn> is an event generated by the user agent when it needs
11975
+
to halt audio playback for an {{AudioContext}}. For example, The user agent may
11976
+
create an interruption when another application requests exclusive access to the
11977
+
audio output hardware. This could happen when there is an incoming call from a
11978
+
VoIP application.
11973
11979
11974
-
The {{AudioContext}} |audioContext| performs the following steps on the <a>rendering thread</a> when an interruption happens.
11980
+
The {{AudioContext}} |audioContext| performs the following steps on the
11981
+
<a>rendering thread</a> when an interruption happens.
11975
11982
11976
-
1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>closed</code> or <code>interrupted</code>:
11983
+
1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>closed</code>
11984
+
or <code>interrupted</code>:
11977
11985
11978
11986
1. Abort these steps.
11979
11987
11980
-
1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>running</code>:
11988
+
1. If the |audioContext|'s {{[[rendering thread state]]}} is
11989
+
<code>running</code>:
11981
11990
11982
11991
1. Attempt to <a>release system resources</a>.
11983
11992
11984
11993
1. [=Queue a media element task=] to execute the following steps:
11985
11994
11986
-
1. Set the |audioContext|'s {{[[control thread state]]}} to <code>interrupted</code>.
11995
+
1. Set the |audioContext|'s {{[[control thread state]]}} to
11996
+
<code>interrupted</code>.
11987
11997
11988
-
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the |audioContext|.
11998
+
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the
11999
+
|audioContext|.
11989
12000
11990
-
1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>suspended</code>:
12001
+
1. If the |audioContext|'s {{[[rendering thread state]]}} is
12002
+
<code>suspended</code>:
11991
12003
11992
12004
1. [=Queue a media element task=] to execute the following steps:
11993
12005
11994
-
1. Set the |audioContext|'s {{[[control thread state]]}} to <code>interrupted</code>.
12006
+
1. Set the |audioContext|'s {{[[control thread state]]}} to
12007
+
<code>interrupted</code>.
11995
12008
11996
-
1. Set the |audioContext|'s {{[[rendering thread state]]}} to <code>interrupted</code>.
12009
+
1. Set the |audioContext|'s {{[[rendering thread state]]}} to
12010
+
<code>interrupted</code>.
11997
12011
11998
-
Note: If the {{AudioContext}} is <code>suspended</code> a {{BaseAudioContext/statechange}} event is not fired for privacy reasons to avoid over-sharing user activity - e.g. when a phone call comes in or when the screen gets locked.
12012
+
Note: If the {{AudioContext}} is <code>suspended</code> a
12013
+
{{BaseAudioContext/statechange}} event is not fired for privacy reasons to avoid
12014
+
over-sharing user activity - e.g. when a phone call comes in or when the screen
12015
+
gets locked.
11999
12016
12000
-
The {{AudioContext}} |audioContext| performs the following steps on the <a>rendering thread</a> when the [=interruption=] ends.
12017
+
The {{AudioContext}} |audioContext| performs the following steps on the
12018
+
<a>rendering thread</a> when the [=interruption=] ends.
12001
12019
12002
-
1. If the |audioContext|'s {{[[rendering thread state]]}} is not <code>interrupted</code>:
12020
+
1. If the |audioContext|'s {{[[rendering thread state]]}} is not
12021
+
<code>interrupted</code>:
12003
12022
12004
12023
1. Abort these steps.
12005
12024
12006
-
1. If the |audioContext|'s {{[[rendering thread state]]}} was <code>running</code> before the [=interruption=] or if the the |audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code> and {{AudioContext/resume}} was called during the [=interruption=]:
12025
+
1. If the |audioContext|'s {{[[rendering thread state]]}} was
12026
+
<code>running</code> before the [=interruption=] or if the the
12027
+
|audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code>
12028
+
and {{AudioContext/resume}} was called during the [=interruption=]:
12007
12029
12008
12030
1. Attempt to <a href="#acquiring">acquire system resources</a>.
12009
12031
12010
-
1. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to <code>running</code>.
12032
+
1. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to
12033
+
<code>running</code>.
12011
12034
12012
12035
1. Start <a href="#rendering-loop">rendering the audio graph</a>.
12013
12036
12014
12037
1. [=Queue a media element task=] to execute the following steps:
12015
12038
12016
-
1. If the {{BaseAudioContext/state}} attribute of the {{AudioContext}} is not already "{{AudioContextState/running}}":
12039
+
1. If the {{BaseAudioContext/state}} attribute of the {{AudioContext}}
12040
+
is not already "{{AudioContextState/running}}":
12017
12041
12018
-
1. Set the |audioContext|'s {{[[control thread state]]}} to <code>running</code>.
12042
+
1. Set the |audioContext|'s {{[[control thread state]]}} to
12043
+
<code>running</code>.
12019
12044
12020
-
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the |audioContext|.
12045
+
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the
12046
+
|audioContext|.
12021
12047
12022
-
1. If the |audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code> before the [=interruption=]:
12048
+
1. If the |audioContext|'s {{[[rendering thread state]]}} was
12049
+
<code>suspended</code> before the [=interruption=]:
12023
12050
12024
-
1. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to <code>suspended</code>.
12051
+
1. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to
12052
+
<code>suspended</code>.
12025
12053
12026
12054
1. [=Queue a media element task=] to execute the following steps:
12027
12055
12028
-
1. Set the |audioContext|'s {{[[control thread state]]}} to <code>suspended</code>.
12056
+
1. Set the |audioContext|'s {{[[control thread state]]}} to
0 commit comments