Display physical dimensions of player
When using browser or system-wide scaling, the player size changes, misleading the user.
This commit is contained in:
parent
e1b7722907
commit
dc2dc823a8
1 changed files with 3 additions and 2 deletions
|
@ -1869,9 +1869,10 @@ function tryRemoveElement(elem) {
|
|||
};
|
||||
categories.push(videoCategory);
|
||||
|
||||
const devicePixelRatio = window.devicePixelRatio || 1;
|
||||
const rect = mediaElement.getBoundingClientRect ? mediaElement.getBoundingClientRect() : {};
|
||||
let height = parseInt(rect.height);
|
||||
let width = parseInt(rect.width);
|
||||
let height = Math.round(rect.height * devicePixelRatio);
|
||||
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
|
||||
if (width && height && !browser.tv) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue