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

Define DisplayMediaStreamConstraints.selfBrowserSurface #216

Merged
merged 11 commits into from
Apr 7, 2022

Conversation

eladalon1983
Copy link
Member

@eladalon1983 eladalon1983 commented Mar 22, 2022

Fixes #209.


Preview | Diff

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated
Comment on lines 734 to 738
<div class="note">
<p>
For clarity's sake, "tab" is used rather than "browser display surface".
</p>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this note, since this prose is largely explanatory. I think it's fine to use "tab" here as a shorthand, as long as normative prose below doesn't use it and sticks to defined terms only.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fine by me. We can remove.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Show resolved Hide resolved
index.html Outdated
@@ -732,6 +788,7 @@ <h2>DisplayMediaStreamConstraints</h2>
dictionary DisplayMediaStreamConstraints {
(boolean or MediaTrackConstraints) video = true;
(boolean or MediaTrackConstraints) audio = false;
CurrentTabPreferenceEnum currentTabPreference = "none";
Copy link
Member

Choose a reason for hiding this comment

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

I could be wrong, but this would be the first time the word "Tab" appears in a web API. I know this was already discussed in the issue, but I can't help thinking we're over-selecting here.

At a conceptual level, the user agent learns whether self-capture (hall of mirrors) is part of the application's use case(s) or not. This seems like valuable information to the user agent, at its most abstract.

It seems less relevant how the user agent ends up acting on this information: whether this applies only to tab-capture or whether it also applies to window capture of the browser window the document is in ... those are really good questions user agents should perhaps be left to figure out, which seems OK to me.

I also don't think it matters if user agents fall short of promises on this today, since this is a hint. E.g. I wouldn't expect browsers to ever exclude full-screen capture over this, but a user agent might take "exclude" as a clue it's OK to blur away the undesirable hall-of-mirrors effect for instance. This way the user agent doesn't need to worry it's stepping on apps that rely on self-capture. cc @youennf

So I'd suggest an iteration on @martinthomson's wording:

Suggested change
CurrentTabPreferenceEnum currentTabPreference = "none";
CurrentTabPreferenceEnum selfCapture = "no-preference";
Copy link
Member Author

@eladalon1983 eladalon1983 Mar 28, 2022

Choose a reason for hiding this comment

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

I'm OK with the s/none/no-preference replacement.
I don't want to accept the s/currentTabPreference/selfCapture suggestion, because this only refers to tabs, and that is intentional - we only got consensus over that in the interim meeting. (Also note how it's CurrentTabPreferenceEnum, btw.)

Copy link
Member

@jan-ivar jan-ivar Mar 29, 2022

Choose a reason for hiding this comment

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

(with chair-hat off)

I recall us having rough agreement (not consensus which would require a call on the list) on this being a "hint", which seems to leave this more as an indicator describing application preference, than an explicit control surface to enact certain specific behavior.

Yes I'm bikeshedding, and perhaps suggesting a bit of abstraction here that wasn't discussed before, but I don't read the last meeting as a final word on naming, and would love to hear from others. I think the question of whether to introduce the term "Tab" to the web platform seems orthogonal to discussion over behavior.

Copy link
Member Author

@eladalon1983 eladalon1983 Mar 30, 2022

Choose a reason for hiding this comment

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

I recall us having rough agreement (not consensus which would require a call on the list) on this being a "hint", which seems to leave this more as an indicator describing application preference, than an explicit control surface to enact certain specific behavior.

This has not changed. We're discussing what the hint will be called.

I think the question of whether to introduce the term "Tab" to the web platform seems orthogonal to discussion over behavior.

If you're not convinced that "tab" can be a convenient shorthand in this case, we can go with the following alternative, although I consider it inferior to "tab":

  SelfCapturePreference selfCaptureBrowser = "no-preference";

  enum SelfCapturePreference {
    "no-preference",
    "include",
    "exclude",
  };

This way:

  1. We use the browser that everyone is already forced to know means "tab" in most relevant contexts.
  2. We have not blocked the way for selfCaptureWindow to be introduced later, if the WG happens to be interested later.

--
But please see my note in the original PR. I think "tab" can be understood well as shorthand for "display surface of type 'browser'". My intention is that this would not formally introduce "tab" into the Web platform, but rather, serve as a localized convenience.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ping @jan-ivar; PTAL.

eladalon1983 and others added 5 commits March 28, 2022 17:54
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
Co-authored-by: Jan-Ivar Bruaroey <jan-ivar@users.noreply.github.com>
@eladalon1983
Copy link
Member Author

eladalon1983 commented Apr 4, 2022

Hi @jan-ivar, could you PTAL?

@youennf
Copy link
Collaborator

youennf commented Apr 7, 2022

I would rename the property to slefBrowserSurface and remove no-preference.

index.html Outdated
"exclude"
};
</pre>
<table data-dfn-for="CurrentTabPreferenceEnum" class="simple">
Copy link
Collaborator

Choose a reason for hiding this comment

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

two spaces

@youennf
Copy link
Collaborator

youennf commented Apr 7, 2022

What we plan to do:

  • rename the property to selfBrowserSurface
  • remove no-preference
  • remove the use of tab and use something like 'browser surface' in the PR, including CurrentTabPreferenceEnum.
Copy link
Collaborator

@youennf youennf left a comment

Choose a reason for hiding this comment

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

Look good to me with the changes.
I think we should beef up the security section since we are now allowing the web page to fiddle with UA UI.

@jan-ivar jan-ivar changed the title Define DisplayMediaStreamConstraints.currentTabPreference Apr 7, 2022
@eladalon1983 eladalon1983 merged commit bc2e4a7 into w3c:gh-pages Apr 7, 2022
@eladalon1983
Copy link
Member Author

Ping @jan-ivar and @youennf with a reminder to double-check the delta from what we agreed on and what I ended up editing and merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants