We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2edd0d3 commit 76713a8Copy full SHA for 76713a8
dotcom-rendering/src/components/SelfHostedVideo.importable.tsx
@@ -529,14 +529,17 @@ export const SelfHostedVideo = ({
529
cue.line = percentFromTop;
530
}
531
532
-
533
- setWidth(video.videoWidth);
534
- setHeight(video.videoHeight);
535
};
536
537
const handleLoadedData = () => {
538
- if (vidRef.current) {
539
- setHasAudio(doesVideoHaveAudio(vidRef.current));
+ const video = vidRef.current;
+ if (!video) return;
+
+ setHasAudio(doesVideoHaveAudio(video));
540
+ if (video.videoWidth > 0 && video.videoHeight > 0) {
541
+ setWidth(video.videoWidth);
542
+ setHeight(video.videoHeight);
543
544
545
0 commit comments