Merge pull request #3420 from dmitrylyzo/fix-player-size-stats

This commit is contained in:
Bill Thornton 2022-02-11 21:37:48 -05:00 committed by GitHub
commit 9ed8204323
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1869,9 +1869,10 @@ function tryRemoveElement(elem) {
}; };
categories.push(videoCategory); categories.push(videoCategory);
const devicePixelRatio = window.devicePixelRatio || 1;
const rect = mediaElement.getBoundingClientRect ? mediaElement.getBoundingClientRect() : {}; const rect = mediaElement.getBoundingClientRect ? mediaElement.getBoundingClientRect() : {};
let height = parseInt(rect.height); let height = Math.round(rect.height * devicePixelRatio);
let width = parseInt(rect.width); let width = Math.round(rect.width * devicePixelRatio);
// Don't show player dimensions on smart TVs because the app UI could be lower resolution than the video and this causes users to think there is a problem // Don't show player dimensions on smart TVs because the app UI could be lower resolution than the video and this causes users to think there is a problem
if (width && height && !browser.tv) { if (width && height && !browser.tv) {