Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial draft of getViewportMedia() #3

Merged
merged 8 commits into from
Mar 10, 2022
Merged

Conversation

jan-ivar
Copy link
Member

@jan-ivar jan-ivar commented Feb 24, 2022

Fixes #1.

I've tried to reflect my understanding of consensus as best I can. We never discussed audio, but since this is in large parts a cut'n'paste from getDisplayMedia, I've kept it in for parity with getDisplayMedia. Open to discuss that if others disagree.

@eladalon1983, @youennf, @alvestrand, @annevk PTAL.


Preview | Diff

index.html Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
respec-config.js Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Show resolved Hide resolved
[=top-level browsing context=]'s
<a href="https://wicg.github.io/document-policy/#required-document-policy">
required document policy</a> does not contain
`Require-Document-Policy: html-capture` (TODO: use correct algorithm),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to define in this spec the said document policy "configuration point"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll look into it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll address this in a followup.

<p>Let <var>constraints</var> be the method's first
argument.</p>
</li>
<li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of copying the content of screen capture, it would be better to make that algorithm re-usable there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The algorithms are different so that doesn't work:

- Prompt the user to choose a display device, for a PermissionDescriptor with its name set
- to "display-capture", resulting in a set of provided media.
+ Request permission to use viewport capture, for a PermissionDescriptor with its name set
+ to "viewport-capture", resulting in a set of provided media.

- The provided media MUST include precisely one video track.
+ The provided media MUST include precisely one video track, which MUST be a live-capture
+ of the browser display surface of the relevant settings object's responsible document's
+ top-level browsing context's viewport.

- The devices chosen MUST be the ones determined by the user. Once selected, the source of a
- MediaStreamTrack MUST NOT change, unless the user permits it through their interaction with
- the user agent.
+ The source of a MediaStreamTrack MUST NOT change.

- User agents are encouraged to warn users against sharing browser display devices as well as
- monitor display devices where browser windows are visible, or otherwise try to discourage
- their selection on the basis that these represent a significantly higher risk when shared.
+ 

- The provided media MUST include at most one audio track. This audio track MUST NOT be
- included if audio was not specified in requestedMediaTypes, or if it was specified as false.
+ The provided media MUST include at most one audio track, which, if provided, MUST be the
+ combined audio produced by the sum of documents that consist of the relevant settings object's
+ responsible document's top-level browsing context's active document, and all active documents
+ in nested browsing contexts of the relevant settings object's responsible document's top-level
+ browsing context.

- For the newly created MediaStreamTrack, the user agent MUST NOT capture the prompt that
- was shown to the user.
- 
- Information that is not currently rendered to the screen SHOULD be obscured in captures unless
- the application has been specifically authorized to access that content (e.g. through means such
- as elevated permissions).
+ 

- The user agent MUST NOT share audio without active user consent, for example if the capture of
- the video of a window is accompanied by capture of the audio of the entire system, including
- applications unrelated to that window.
+ The user agent MUST NOT share the audio other than audio emitted from the captured tab,
+ and MUST NOT share audio of the entire system.

There's also a precedent here in w3c/mediacapture-screen-share#73.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it still feels that an algorithm with parameters could handle both; but maybe that's an unneeded optimization; I worry about improvements being brought in one place and missed in the other.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eladalon1983 and I discussed this this morning and we both prefer to keep the algorithms separate.

We need to worry either way (whether improvements were meant for both or just one or the other), and WPT tests still need to be written for both, so we don't see it as a big savings for us as editors.

jan-ivar and others added 4 commits March 9, 2022 17:40
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
@alvestrand
Copy link

Editors can integrate. The status should be "UD" (Unofficial Draft) until we have had a Call for Adoption.

@jan-ivar jan-ivar merged commit ea7fe46 into w3c:main Mar 10, 2022
@jan-ivar jan-ivar deleted the firstdraft branch March 10, 2022 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getViewportMedia(): Let pages opt-in to capture
3 participants