Re: [mediacapture-screen-share] Identification of Captured Application By Capturer (#166)

> 1. MediaSession-based communication.

@youennf Reusing mediaSession, while intriguing, seems risky design-wise and scope-wise: repurposing a well-known API with a known a trust model to now also be something else. I don’t see a lot of user benefit frankly.

I'd prefer keeping what's exposed in this WG. We have to be careful not to add ways for malicious sites to remotely operate arbitrary captured pages in ways that may deceive users. E.g. `triggerAction()` needs [transient activation]( to start.

I’m also not sure “advance slide” is the same thing as “next track”: e.g. a presenter may have background music playing, and expect the latter to skip to the next audio track, not advance to the next slide.

While "play", "pause" and "resume" may be reasonable, what if capturee has two video elements, which one plays? I sense  a slippery slope here toward users asking to click on buttons in the capture preview and have it affect buttons in the capturee page. While this might be useful, if done wrong (letting JS control coordinates) it might let scammers remotely operate a user's browser.

So my instinct is we want to tightly control this separate from mediaSession.

> 2. MessageChannel-based communication
> ... capturee and capturer uses the MessageChannel ports to directly communicate...

I'd rather avoid adding another messaging channel to the platform. Also, as soon as such a channel exists, the parties can exchange IDs anyway, so this seems like a superset of @eladalon1983's approach.

> ```
> partial interface MediaDevices {
>     attribute EventHandler ongetdisplaymediaresult;
> }
> ```

I have to say I like how this separates the control surface from the MediaStreamTrack. Tracks can be cloned and transferred, and it's not clear to me this surface should follow it, e.g. to a worker (would `track.triggerAction("next slide")` work there? Do workers have transient activation?) — But if getDisplayMedia is called twice in a row, how does JS know which one it is?

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Thursday, 20 January 2022 00:16:53 UTC