diff --git a/mediasession.bs b/mediasession.bs index f908f12..6c2a2e4 100644 --- a/mediasession.bs +++ b/mediasession.bs @@ -215,7 +215,8 @@ conforming IDL fragments, as described in the Web IDL specification. [[!WEBIDL]] interface MediaSession { readonly attribute MediaSessionKind kind; - void deactivate(); + Promise<void> activate(); + Promise<void> deactivate(); }; enum MediaSessionKind { @@ -243,14 +244,19 @@ sessions.
session . {{MediaSession/activate()}}
+ active
.
+ session . {{MediaSession/deactivate()}}
idle
and
- applies any changes necessary to its
- audio-producing participants.
+ Releases platform-level media focus and sets the media session's
+ state to idle
.
kind
attribute must return the media session's kind.
+The activate()
method, when
+invoked, must run these steps:
+
+TypeError
.
+ deactivate()
method, when
-invoked, must deactivate the context object.
+invoked, must run these steps:
+
+active
media
+session may be interrupted at any time. This typically occurs when another
+application or another media session requests and is granted a level of
+platform media focus that affects the media session based on its
+kind.
Interruptions can be both transient or permanent. A transient interruption means
we can either choose to duck our media content and continue playing it
@@ -699,10 +752,9 @@ The media session interruption algorithm takes one argument,
state">idle.
- This implies that the next time the media session activation - algorithm is run against media session that we will - re-request media focus according to the steps defined in that - algorithm. + This implies that the next time the media session is + activated, that we will re-request media focus according to + the steps defined in that algorithm.
idle
.
- This implies that the next time the media session activation - algorithm is run against media session that we will - re-request media focus according to the steps defined in that algorithm. + This implies that the next time the media session is + activated, that we will re-request media focus according to the + steps defined in that algorithm.
AudioContext
interface
AudioContext
object
- AudioContext
object
- AudioContext
object
MediaSession
object.
session . kind
session . activate()
+ active
.
session . deactivate()
- idle
and
- applies any changes necessary to its audio-producing participants.
+ idle
.
The MediaSession(kind)
constructor, when invoked, must return a new media session whose kind is kind, and state is idle
.
The kind
attribute must return the media session’s kind.
The activate()
method, when
+invoked, must run these steps:
TypeError
.
+ Note: activate()
can fail if there is an ongoing high-priority activity,
+e.g. a phone call.
The deactivate()
method, when
-invoked, must deactivate the context object.
Note: Unlike activate()
, deactivate()
cannot fail.
A media session has a state that describes its current status with respect to any platform-level interactions and @@ -384,7 +402,7 @@
The media session activation algorithm takes one argument, media session, and consists of the following steps:
+To activate a media session, run these steps:
active
, then return success.
A media session may be interrupted at any time after its media session activation algorithm has been run. This typically occurs -when another application or another media session requests and is granted -a level of platform media focus that affects the media session based on -its kind.
+An active
media
+session may be interrupted at any time. This typically occurs when another
+application or another media session requests and is granted a level of
+platform media focus that affects the media session based on its kind.
Interruptions can be both transient or permanent. A transient interruption means we can either choose to duck our media content and continue playing it out at a reduced volume for the duration of the interruption; or pause our media content for the duration of the interruption and, then, resume @@ -455,10 +473,8 @@
content
" then indefinitely pause all of media session’s audio-producing participants and set media
session’s state to idle
.
- This implies that the next time the media session activation - algorithm is run against media session that we will - re-request media focus according to the steps defined in that - algorithm.
+This implies that the next time the media session is activated, that we will re-request media focus according to + the steps defined in that algorithm.
idle
.
- This implies that the next time the media session activation - algorithm is run against media session that we will - re-request media focus according to the steps defined in that algorithm.
+This implies that the next time the media session is activated, that we will re-request media focus according to the + steps defined in that algorithm.
HTMLMediaElement
interfacepartial interface HTMLMediaElement { @@ -658,10 +673,8 @@audio-producing participants, then append media element to this list. -
HTMLMediaElement
objectAudioContext
objectWhen the resume()
method on an AudioContext
object is invoked from
-script and that AudioContext
object’s state
attribute is "suspended
"
-then the user agent must run the following steps:
AudioContext
object.
- AudioContext
objectWhen the user agent is to suspend a web audio object for a given AudioContext
object it must invoke that AudioContext
object’s suspend()
method.
When the user agent is to resume a web audio object for a given AudioContext
object it must invoke that AudioContext
object’s resume()
method.
AudioContext
objectWhen an AudioContext
object’s state
attribute transitions to
-"closed
", the user agent must release web audio object from its media
-session.
When the user agent is to release web audio object from its media
-session for a given AudioContext
object it must run the following
-steps:
AudioContext
object.
- This section is non-normative.