Skip to content

Commit

Permalink
fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
binarykitchen committed Nov 23, 2024
1 parent 4c58065 commit 5fc24c1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/wrappers/visuals/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,24 @@ class Replay extends Despot {
}

if (!height) {
const element = this.visuals.getElement() ?? document.body;
height = calculateHeight(responsive, videoWidth, this.options, ratio, element);
let element = this.visuals.getElement();
let target;

if (element) {
target = "visualsElement";
} else {
element = document.body;
target = "document body";
}

height = calculateHeight(
responsive,
videoWidth,
this.options,
target,
ratio,
element,
);
}

if (width > 0) {
Expand Down

0 comments on commit 5fc24c1

Please sign in to comment.