-
Notifications
You must be signed in to change notification settings - Fork 29
Should screen capture tracks expose deviceId? #308
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
Comments
@eladalon1983 mentioned how
The screen capture spec could try to define tab capture in terms of top level traversable. |
On the one hand, yes, this seems potentially useful. On the other hand, realistically, we cannot expect all user agents to prioritize this work in the short-term. I'd be more comfortable allowing this behavior than mandating it. I'd also suggest scoping the persistence of the ID to successive getDisplayMedia() calls by the same Document. That is:
Wdyt? |
I would go with mandating the behaviour, otherwise there is no real point for a spec.
What are we trying to protect?
Device IDs should be hashed per origins yes, just like cameras and microphones. |
As per media capture main spec, |
The authors of RFC 2119 seem to have had a different opinion, and that appears to be the industry standard atm. Specifically, I am thinking we could use "SHOULD" here.
Thinking out loud:
Is it a problem? I am not sure. But do we want to engage a lengthy privacy review of something no Web developer has asked for yet? I worry it might not be good use of anyone's time. If we start small and it's proven useful, we could consider extensions later.
Great, we're in agremenet here. And likely this already yields the result I was after for the previous point? |
Yes, I think starting with per-document IDs is ok with me. |
I don't find the use cases compelling.
This seems to invite applications to make mistaken assumptions. Same tab ≠ same document.
Other alternatives in w3c/mediacapture-screen-share-extensions#15 seem simpler than overloading
Again, any assumption of what "same" means here seems unsound. Tabs may have navigated. |
Generally, I also don't have use cases in mind at the moment, but I'd love for us to phrase the spec in a way that would not constrain Safari from offering functionality they believe in. Hence my suggestion of SHOULD. I do have one compelling, semi-adjacent use case, though - that of knowing when the app is capturing the current tab. At the moment, this is possible, but requires non-trivial work; see explanation for the explanation and demo. Possibly we could specify that self-capture (the app capturing its own tab) is exposed via a unique ID that's pre-specified?
That's a valid concern, but I am not sure if it's significant one - Web developers are competent enough to either use the information correctly, or to knowingly choose to employ it as a heuristic, despite its failures. (I find as more convincing the question of whether any Web developer needs this.) |
I agree with @youennf there is no real point in a spec like that.
Some web developers are, others absolutely not. My point here is that there are no use cases for detecting the same navigable. It is the wrong solution to a problem. |
So there is no consensus on the general case. What about the following specific case?
We could say that |
We've agreed that self-capture as a use case deserves its own API. Self-capture as a mistake seems better solved in browser UX. Self-capture today carries unique risks, so I'm not in favor of making it (more) detectable. |
We are not talking same navigable but same surface. Please also note that surface IDs information already surface in
Here is a use case that is better served by Changing of surface is a good event as input for chapterization. Also, the web page will want to know when the first video frame of the new surface will happen, to encode it as a key frame and to get its precise timestamp. This issue is not solvable with the callback approach (which has the disadvantage of pausing video frames which we do not want here). One way to solve this is to synchronise settings/configurationchange with the enqueuing of VideoFrames in the worker (same task queue basically). Another solution is to add metadata to VideoFrames. I'll file an issue about this. |
In the case of tab capture, the surface is (the rendered form of) a navigable.
I'm not sure how realistic that use case is. It seems to make a lot of assumptions, like the user having several screens or windows of reasonably similar dimensions (to produce a recording with a consistent resolution). Maybe with tab capture and different tabs of the same window which would all having the same resolution. But even then, it's not clear what should constitutes a "chapter":
If we're serious about solving this use case, a better approach might be to relax |
This issue had an associated resolution in WebRTC December 2024 meeting – 10 December 2024 ([screen-share] Issue 308: Should screen capture tracks expose deviceId?):
|
I had a look at other sources (canvas capture track, webrtc remote track, web audio track). |
Please file a bug on chromium. |
As seen in #306, Chrome and Safari are exposing
deviceId
on getDisplayMedia tracks. Firefox is not.There are a couple of use cases that could make it useful for exposing deviceId:
deviceId
can be used to let knowconfigurationchange
listeners that a surface switch happens. This could be useful for instance with MSTP which lives in a worker.The text was updated successfully, but these errors were encountered: