From a50fe14a461015e9c8fc036c6c5315fb2b6757f2 Mon Sep 17 00:00:00 2001 From: Daniel Vogelheim Date: Thu, 9 Apr 2026 14:46:37 +0200 Subject: [PATCH] Update usermedia-element-delta spec --- README.md | 3 +- usermedia-element-delta.html | 73 ++++++++++++++++++++++++------------ 2 files changed, 52 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d7ccaf0..bf871ee 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ A set of HTML elements to mediate access to a [MediaStream](https://www.w3.org/T # Page Embedded Permission Control (PEPC) The originally proposed permission element, for any -[permission](https://www.w3.org/TR/permissions/) +[permission](https://www.w3.org/TR/permissions/). This proposal is no longer +pursued. * [Explainer for PEPC](explainer.md) * [Permission Element Specification draft](https://wicg.github.io/PEPC/permission-element.html) diff --git a/usermedia-element-delta.html b/usermedia-element-delta.html index a125ec7..a78e14f 100644 --- a/usermedia-element-delta.html +++ b/usermedia-element-delta.html @@ -14,8 +14,8 @@ editors: [{name: "Daniel Vogelheim", company: "Google LLC"}], specStatus: "UD", shortName: "proposed-usermedia-html-elements", - edDraftURI: "https://wicg.github.io/PEPC/usermedia-elements.html", - canonicalURI: "edDraft", + edDraftURI: "https://wicg.github.io/PEPC/usermedia-element-delta.html", + latestVersion: null, noRecTrack: true, localBiblio: { "mediacapture-extensions": { @@ -250,9 +250,14 @@

Algorithms

  1. If |element|.{{ActivationBlockersMixin/isValid}} is false, then return.
  2. -
  3. If {{HTMLUserMediaElement/[[stream]]}} is null, run +
  4. If {{HTMLUserMediaElement/[[stream]]}} is null, run the [=HTMLUserMediaElement/activation initial=] steps.
  5. -
  6. Otherwise, run [=HTMLUserMediaElement/activation second=] steps.
  7. +
  8. Otherwise, if + {{HTMLUserMediaElement/[[stream]]}}.{{MediaStream/active}} + is false, run the [=HTMLUserMediaElement/activation inactive=] + steps.
  9. +
  10. Otherwise, run the [=HTMLUserMediaElement/activation active=] + steps.

The activation initial steps @@ -297,34 +302,56 @@

Algorithms

-

The activation second steps +

The activation inactive steps are:

  1. [=Assert=]: |element|.{{ActivationBlockersMixin/isValid}}.
  2. [=Assert=]: {{HTMLUserMediaElement/[[stream]]}} is a {{MediaStream}}.
  3. -
  4. TODO: We ought to do something here, too. +
  5. [=Assert=]: {{HTMLUserMediaElement/[[stream]]}}.{{MediaStream/active}} + is false.
  6. +
  7. [=list/iterate|For each=] {{MediaStreamTrack}} |track| of + {{HTMLUserMediaElement/[[stream]]}}'s [=track set=]: +
      +
    1. Set |track|.{{MediaStreamTrack/enabled}} to true. +
    +
  8. +
+ +

The activation active steps + are:

+
    +
  1. [=Assert=]: |element|.{{ActivationBlockersMixin/isValid}}.
  2. +
  3. [=Assert=]: {{HTMLUserMediaElement/[[stream]]}} is a + {{MediaStream}}.
  4. +
  5. [=Assert=]: {{HTMLUserMediaElement/[[stream]]}}.{{MediaStream/active}} + is true.
  6. +
  7. Let |muted| be false.
  8. +
  9. [=list/iterate|For each=] {{MediaStreamTrack}} |track| of + {{HTMLUserMediaElement/[[stream]]}}'s [=track set=]: +
      +
    1. If |track|.{{MediaStreamTrack/muted}}, set |muted| to true. +
    +
  10. +
  11. [=list/iterate|For each=] {{MediaStreamTrack}} |track| of + {{HTMLUserMediaElement/[[stream]]}}'s [=track set=]: +
      +
    1. Set |track|.{{MediaStreamTrack/muted}} to ¬|muted|. +
    +

The constraint filter steps for an |element| and {{MediaStreamConstraints}} |constraints| are:

    -
  1. Let |result| be a new [=dictionary=]. -
  2. If |element| is a {{HTMLUserMediaElement}}, - set |result| to «[ - {{MediaStreamConstraints/audio}} → |constraints|[{{MediaStreamConstraints/audio}}], - {{MediaStreamConstraints/video}} → |constraints|[{{MediaStreamConstraints/video}}] - ]».
  3. -
  4. Otherwise, if |element| is a {{HTMLMicrophoneElement}}, - set |result| to «[ - {{MediaStreamConstraints/audio}} → |constraints|[{{MediaStreamConstraints/audio}}], - {{MediaStreamConstraints/video}} → false - ]».
  5. -
  6. Otherwise, if |element| is a {{HTMLCameraElement}}, - set |result| to «[ - {{MediaStreamConstraints/audio}} → false, - {{MediaStreamConstraints/video}} → |constraints|[{{MediaStreamConstraints/video}}] - ]».
  7. +
  8. Let |result| be a new [=dictionary=].
  9. +
  10. Let |defaults| be |element|'s [=default constraints=].
  11. +
  12. For |key| of « {{MediaStreamConstraints/audio}}, {{MediaStreamConstraints/video}} »: +
      +
    1. If |defaults|[|key|] is true, then set |result|[|key|] to |constraints|[|key|].
    2. +
    3. Otherwise, set |result|[|key|] to false.
    4. +
    +
  13. TODO: |results| should have additional filtering to support a reasonable, easy-to-use subset of all the constraints allowed for the getUserMedia call.
  14. @@ -360,7 +387,7 @@

    <usermedia> legacy support.

    `"video audio"`
    — behaves like a regular <usermedia> element.
    `"audio"`
    -
    — behaves like an <microphone> element.
    +
    — behaves like a <microphone> element.
    `"video"`
    — behaves like a <camera> element.
    all other values