From 99781c870e0a345faf175015a30a3719cbef4dd0 Mon Sep 17 00:00:00 2001
From: Marcos Caceres
- In order to make play and
- pause actions work properly,
+ In order to make {{MediaSessionAction/play}} and
+ {{MediaSessionAction/pause}} actions work properly,
the user agent SHOULD be able to determine if a browsing context of
the active media session is playing media or not, which is called
the guessed playback state. The RECOMMENDED way for determining
@@ -237,17 +238,16 @@ conforming IDL fragments, as described in the Web IDL specification. [[!WEBIDL]]
state is combined with the guessed playback state to compute the
actual playback state, which is a finalized state and will be
used for
- play and
- pause actions.
+ {{MediaSessionAction/play}} and
+ {{MediaSessionAction/pause}} actions.
The actual playback state is computed in the following way:
The {{MediaSession/playbackState}} attribute could be useful when the page
wants to do some preparation steps when the media is paused but it allows
- the preparation steps to be interrupted by pause action. See Setting playbackState for example.
Conformance
@@ -217,8 +218,8 @@ conforming IDL fragments, as described in the Web IDL specification. [[!WEBIDL]]
Playback State
metadata
of the active media
+ media session changes or setting {{MediaSession/metadata}} of the active media
session, the user agent MUST run the update metadata
algorithm. The steps are as follows:
@@ -313,13 +311,13 @@ conforming IDL fragments, as described in the Web IDL specification. [[!WEBIDL]]
presented to the platform, and terminate these steps.
metadata
of the
+ If the {{MediaSession/metadata}} of the
active media session is an empty metadata, unset the media
metadata presented to the platform, and terminate these steps.
metadata
for the
+ Update the media metadata presented to the platform to match the
+ {{MediaSession/metadata}} for the
active media session.
artwork
of the active media
+ If metadata's {{MediaMetadata/artwork}} of the active media
session is empty, then terminate these steps.
artwork
of the active
+ preferred artwork image from metadata's
+ {{MediaMetadata/artwork}} of the active
media session.
null
,
+ target is `null`,
the active media session is the recipient of all
media session action source's actions.
null
, remove action
+ If handler is `null`, remove action
from the supported media session actions for {{MediaSession}}
and abort these steps.
null
, set session to
+ If session is `null`, set session to
the active media session.
null
, abort these steps.
+ If session is `null`, abort these steps.
null
, abort these
+ If the active media session is `null`, abort these
steps.
A {{MediaSession}} has an associated metadata
- object represented by a {{MediaMetadata}}. It is initially null
.
+ object represented by a {{MediaMetadata}}. It is initially `null`.
@@ -801,23 +798,23 @@ interface MediaSession {
The metadata
attribute
- reflects the {{MediaSession}}'s metadata. On getting,
- it MUST return the {{MediaSession}}'s metadata. On
+ reflects the {{MediaSession}}'s {{MediaSession/metadata}}. On getting,
+ it MUST return the {{MediaSession}}'s {{MediaSession/metadata}}. On
setting, it MUST run the following steps with value being the new
value being set:
null
, set its media session to
- null
.
+ If the {{MediaSession}}'s {{MediaSession/metadata}} is not
+ `null`, set its [=MediaMetadata/media session=] to
+ `null`.
null
, set its media session to the
+ If the {{MediaSession}}'s {{MediaSession/metadata}} is not
+ `null`, set its [=MediaMetadata/media session=] to the
current {{MediaSession}}.
A {{MediaMetadata}} is said to be an empty metadata if it is equal
- to null
or all the following conditions are true:
+ to `null` or all the following conditions are true:
The MediaMetadata(init)
+ for="MediaMetadata">MediaMetadata(init)
constructor, when invoked, MUST run the following steps:
- The title
attribute
+ The title attribute
reflects the {{MediaMetadata}}'s title. On getting,
it MUST return the {{MediaMetadata}}'s title. On
setting, it MUST set the {{MediaMetadata}}'s title to
@@ -1065,7 +1062,7 @@ invoked, the user agent MUST run the following steps:
- The artist
attribute
+ The artist attribute
reflects the {{MediaMetadata}}'s artist. On getting,
it MUST return the {{MediaMetadata}}'s artist. On
setting, it MUST set the {{MediaMetadata}}'s artist
@@ -1073,7 +1070,7 @@ invoked, the user agent MUST run the following steps:
- The album
attribute
+ The album attribute
reflects the {{MediaMetadata}}'s album. On getting,
it MUST return the {{MediaMetadata}}'s album. On
setting, it MUST set the {{MediaMetadata}}'s album to
@@ -1081,7 +1078,7 @@ invoked, the user agent MUST run the following steps:
- The artwork
+ The artwork
attribute reflects the {{MediaMetadata}}'s artwork
images. On getting, it MUST return the result of the following steps:
"podcast.jpg"
or "podcast.png"
for a
- low-pixel-density screen, and "podcast_hd.jpg"
- or "podcast_hd.png"
for a high-pixel-density screen. If the user
+ `"podcast.jpg"` or `"podcast.png"` for a
+ low-pixel-density screen, and `"podcast_hd.jpg"`
+ or `"podcast_hd.png"` for a high-pixel-density screen. If the user
agent wants to use an image for lockscreen background,
- "podcast_xhd.jpg"
will be preferred.
+ `"podcast_xhd.jpg"` will be preferred.