Skip to content

Commit 5fc24c1

Browse files
committed
fix ts error
1 parent 4c58065 commit 5fc24c1

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/wrappers/visuals/replay.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,24 @@ class Replay extends Despot {
9292
}
9393

9494
if (!height) {
95-
const element = this.visuals.getElement() ?? document.body;
96-
height = calculateHeight(responsive, videoWidth, this.options, ratio, element);
95+
let element = this.visuals.getElement();
96+
let target;
97+
98+
if (element) {
99+
target = "visualsElement";
100+
} else {
101+
element = document.body;
102+
target = "document body";
103+
}
104+
105+
height = calculateHeight(
106+
responsive,
107+
videoWidth,
108+
this.options,
109+
target,
110+
ratio,
111+
element,
112+
);
97113
}
98114

99115
if (width > 0) {

0 commit comments

Comments
 (0)