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

Detect whether an element is eligible for capture #31

Open
mfoltzgoogle opened this issue Sep 12, 2023 · 2 comments
Open

Detect whether an element is eligible for capture #31

mfoltzgoogle opened this issue Sep 12, 2023 · 2 comments

Comments

@mfoltzgoogle
Copy link
Contributor

In Chrome's implementation, elements must meet certain criteria to be eligible for capture; this is also outlined in the spec:

https://screen-share.github.io/element-capture/#elements-eligible-for-restriction

Developers may find it helpful to know whether an element is currently eligible for element capture. This could help with debugging site layout and style that might interfere with capture, or with offering a UI that gives users a choice of which element should be captured (so that non-eligible elements aren't offered).

@mfoltzgoogle
Copy link
Contributor Author

With PR #34, we no longer require elements to be eligible for capture to call restrictTo(). Therefore developers can indirectly determine whether the element is eligible by seeing if frames are being produced for a given target (assuming that other conditions are met).

@eladalon1983
Copy link
Contributor

In the future, it might be useful to expose a MuteReason when this happens (link). For now, I think the state of the art is satisfactory - I expect most applications can structure themselves to avoid making the target-element ineligible for capture. Failure to produce frames will likely be caught in testing.

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