Re: [w3ctag/design-reviews] Physical and logical resolution for screen-capture MediaStreamTracks (Issue #1060)

guidou left a comment (w3ctag/design-reviews#1060)

> The term devicePixelRatio is typically used to denote the ratio between physical and logical pixels. Introducing screenDisplayRatio may lead to confusion. We recommend using established property names to maintain clarity and consistency.

The WebRTC WG discussed this recently. The WG decided that the ratio we want to report should include the effects of OS zoom, but not include the effect of page zoom; therefore, its definition would be different from `window.devicePixelRatio`'s. The WG decided that a new name (`screenPixelRatio`) would be a better choice name since it expresses that it is not the same as `window.devicePixelRatio` and reasonably conveys the idea that it is a ratio that applies to the whole screen (not just a tab, for example). The WG judged that reusing the name `devicePixelRatio` would cause confusion since developers could reasonably believe that it has the same definition as `window.devicePixelRatio`. The explainer has been updated to use the name agreed upon by the WG.


> The proposal currently lacks an event interface to handle changes in pixel ratio. For example, if a user adjusts the pixel ratio level during screen sharing (such as zooming in or out on a shared tab), the overall size remains the same, but the pixel ratio changes. Without an event interface, these changes cannot be processed

MediaStreamTrack has an event called [`configurationchange`](https://w3c.github.io/mediacapture-extensions/#dom-mediastreamtrack-onconfigurationchange) to handle configuration changes, which include changes to settings such as the proposed one. The latest version of the explainer includes an example where this event is used to update the sent resolution when `screenPixelRatio` changes.



-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1060#issuecomment-2862770543
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1060/2862770543@github.com>

Received on Thursday, 8 May 2025 11:54:06 UTC