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

Cross-Type Surface Switching #16

Open
tovepet opened this issue Oct 21, 2024 · 1 comment
Open

Cross-Type Surface Switching #16

tovepet opened this issue Oct 21, 2024 · 1 comment

Comments

@tovepet
Copy link

tovepet commented Oct 21, 2024

Note: This is a new issue separated out from #4

Some browsers allow users to switch an ongoing screen-capture to instead share another surface. Currently, such surface switching is primarily between surfaces of the same type, and we would like to expand this functionality to also allow surface-switching between different types of surfaces.

However, some applications adapt their behavior to what type of surface they share. In the case of existing applications they typically check the type of the track returned from getDisplayMedia and then expect the type to remain constant throughout the capture. For backward compatibility with such applications, we propose an opt-in to enable cross-type surface switching:

getDisplayMedia({allowCrossTypeSurfaceSwitching: “include”});

Initially, the default value for this option should be “exclude”, but as applications are updated to handle cross-type surface switching, it should be possible to change the default value to “include”, and eventually remove this option. The default value for this option can be left unspecified to let each browser vendor decide.

Note: Reusing the same track-object for cross-type surface-switching is incompatible with using different JavaScript classes for different surface-types. While the Region Capture spec allows browsers to use a subclass of MediaStreamTrack for tab-captures, it does not require it. To minimize the scope of this issue, changes to the Region Capture spec are better left for a follow-up issue.

@eladalon1983
Copy link
Member

eladalon1983 commented Oct 21, 2024

nit: Possibly change "allowCrossTypeSurfaceSwitching" to "crossTypeSurfaceSwitching". In my humble opinion, crossTypeSurfaceSwitching: "include" flows better than allow...: "include".

(Note for those who might be new to this - the "include"/"exclude" pattern is pre-existing. Whatever one might think of this pattern, it can't be denied that consistency is nice.)

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

2 participants