Re: [mediacapture-surface-control] Is gesture forwarding tied to capture controller or to MediaStreamTrack (#45)

> But with the proposal of `CaptureController.forwardWheelFrom(element)`, it is neither confusing, **nor do we need to compromise on functionality**. So I don't see a reason to change away from that proposed API.

CaptureController.forwardWheelFrom(element) is confusing and limiting, because it's not possible to forward gestures from two different elements. E.g. the following doesn't do that (second call overrides the first):
```js
captureController.forwardWheelFrom(videoElement1);
captureController.forwardWheelFrom(videoElement2);
```
A pivot to putting the API on the element solves this:

> All of these precedents are on `HTMLMediaElement`, not on `HTMLElement`. They are somewhat natural for a media-element, but would be quite confusing for a non-media-element.

I'm not proposing putting anything on `HTMLElement`.

I propose putting the same API on both `HTMLVideoElement` and `Canvas`. The precedent is `captureStream` which exists on both [HTMLMediaElement](https://w3c.github.io/mediacapture-fromelement/#dom-htmlmediaelement-capturestream) and [Canvas](https://w3c.github.io/mediacapture-fromelement/#dom-htmlcanvaselement-capturestream).

Assuming I compromise on permission and promise, this might look like:
```js
await videoElement1.forwardGestures(true);
await canvas2.forwardGestures(true);
```
This shape allows UAs to work on click-jacking mitigations as needed, and communicate needed restrictions to web developers, such as: UAs MAY impose requirements for forwarding to work, e.g.
- `videoElement1` must be playing back (a recent approximation of) the capture, in a manner deemed visible to users
- `canvas2` must have had a recent frame drawn to it from that capture, in a manner deemed visible to users

The exact restrictions can remain vague to allow UAs to experiment. It's in their interest not to break legitimate usage.

I see the emoji overlay as a separate (CSS) problem. Critically, I see no reason to expand the hit zones for wheel input:
<img width="680" alt="image" src="https://github.com/user-attachments/assets/dba5856e-53dc-4f95-af04-01b72c8808c4" />

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-surface-control/issues/45#issuecomment-2546927355 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 16 December 2024 22:03:31 UTC