-
Notifications
You must be signed in to change notification settings - Fork 6
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
Why does element capture double the devicePixelRatio? #44
Comments
Thanks for reporting this! Note - I don't think this is a spec issue, but rather an implementation issue. I'll take up filing the Chromium bug for you, after I have run some internal queries first. I'll close this issue (since it's not a spec issue), but if you don't hear back from me in 1 week, please feel free to ping. |
thanks @eladalon1983! followup questions: if you disable the css outline for e.g. greenDiv, you can check that video.videoWidth is exactly greenDiv.clientWidth * devicePixelRatio, where devicePixelRatio is the modified value (2) in the example above. This is seems very strange to me. why would i want to scale up the captured element? i would like my capture stream to have the element dimensions (and change with it). So I tried to solve this be setting the capture stream width to the target clientWidth, and use a ResizeObserver to update the stream width when the target width changes. However, I found out that be setting a fixed stream width I can affect the behavior of the original element, which goes against the spec, moreover it seems I can effect the behavior of an element in another tab! namely, when you call requestFullScreen on the original element captured in the same tab, or on document.body of a different captured tab, it will be down-sampled to the defined stream width?! I will try to prepare a demo for you, lmk if you want to get on a call |
to recreate the original size effect issue:
so if i am not going crazy, this issue is preventing me from dynamically setting the stream width as mentioned above, with the goal of solving the double resolution issue... |
The changing of devicePixelRatio is messing up my canvases...
I am not sure if this is an element-capture issue or a general screen capture issue, and I did not find answers in the specs.
Is this intended behavior? If so why? and how could I deal with it? I also tried to play with resizeMode and logicalSurface properties to prevent this, but they had no effect.
The text was updated successfully, but these errors were encountered: