This commit is contained in:
Tamius Han 2021-05-11 22:42:51 +02:00
parent 4427844a41
commit 18d7414b90

View File

@ -468,17 +468,17 @@ class VideoData {
} catch (e) { } catch (e) {
} }
// THIS BREAKS PANNING // THIS BREAKS PANNING
const cs = window.getComputedStyle(this.video); const videoComputedStyle = window.getComputedStyle(this.video);
const pcs = window.getComputedStyle(this.player.element); const playerComputedStyle = window.getComputedStyle(this.player.element);
try { try {
const transformMatrix = cs.transform.split(')')[0].split(','); const transformMatrix = videoComputedStyle.transform.split(')')[0].split(',');
const translateX = +transformMatrix[4]; const translateX = +transformMatrix[4];
const translateY = +transformMatrix[5]; const translateY = +transformMatrix[5];
const vh = +(cs.height.split('px')[0]); const vh = +(videoComputedStyle.height.split('px')[0]);
const vw = +(cs.width.split('px')[0]); const vw = +(videoComputedStyle.width.split('px')[0]);
const ph = +(pcs.height.split('px')[0]); const ph = +(playerComputedStyle.height.split('px')[0]);
const pw = +(pcs.width.split('px')[0]); const pw = +(playerComputedStyle.width.split('px')[0]);
// TODO: check & account for panning and alignment // TODO: check & account for panning and alignment
if (transformMatrix[0] !== 'none' if (transformMatrix[0] !== 'none'