这是indexloc提供的服务,不要输入任何密码
Skip to content

Add preferCurrentTab to getDisplayMedia #32

@eladalon1983

Description

@eladalon1983

Introduction

Sites often wish to self-capture. For example, a slides deck application might wish to let the user stream the presentation to a virtual conference.

Calling getDisplayMedia offers the user a wide selection of possible capture-sources. What if the application really just wants the current tab? It could be hard for the user to hunt down the specific tab out of all the tabs they have open.

Ideally, the application would be able to present a confirmation-only dialog to the user - share the current tab, yes/no? Standardization efforts for this feature as getViewportMedia are underway.

However, getViewportMedia will be gated by (1) cross-origin isolation and (2) an opt-in header. That will limit adoption, at least initially.

We therefore extend getDisplayMedia in a way that allows the application to inform the browser that it prefers the current tab. getDisplayMedia currently accepts a single parameter of type MediaStreamConstraints (a dictionary). We extend that dictionary with a new member called preferCurrentTab. This new member is a boolean defaulting to false. When set to true, the browser presents the current tab as the most prominent option.

Screen Shot 2021-06-09 at 15 29 40

This is an imperfect solution; a compromise between two needs:

  • Applications need a way to signal preference for the current tab. Possibly even exclusive need of the current tab.
  • getViewportMedia is a long way off, and the security requirements gating it will need a long time to gain widespread adoption.

Feedback (Choose One)

Please provide all feedback below.

Explainer: preferCurrentTab - Explainer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions