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

Prevent uncropping #76

Open
eladalon1983 opened this issue Feb 14, 2023 · 0 comments
Open

Prevent uncropping #76

eladalon1983 opened this issue Feb 14, 2023 · 0 comments

Comments

@eladalon1983
Copy link
Member

eladalon1983 commented Feb 14, 2023

Consider an application that self-captures, crops to a region of interest, and then posts the track on to a cross-origin iframe. One typical scenario for this would be when a general application embeds a third-party service that provides video-conferencing capabilities.

image

Because it's possible to change crop-targets, and even undo cropping altogether, the cross-origin iframe was basically given permission to capture the entire tab, which might be more than the original owner of the track intended. The receiver would even be able to embed third-party content and then re-crop to only capture that content!

It would be good if a mechanism existed to "lock-in" a track to its current crop-target, disallowing further calls to cropTo().

I propose:

partial interface MediaStreamTrack {
  void lockCropTarget();
}

I think this is the MVP. Theoretically, we could specify an unlock() mechanism, to be available only in the origin of the original locker. But I think we don't need to do that yet; the original could polyfill this by keeping an uncropped clone. We can revisit if the need arises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant