From a4785efcdc431dcad7bdc5dfb2f210f3f25359ea Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 12 Apr 2023 05:40:42 -0700 Subject: [PATCH] psvideo: prevent illegal play attempts Signed-off-by: Varun Patil --- src/components/viewer/PsVideo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index c7e37ed4..d6611471 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -227,7 +227,7 @@ class VideoContentSetup { }); setTimeout(() => { - content.videojs.play(); // iOS needs this + content.videojs?.play(); // iOS needs this }, 200); let canPlay = false; @@ -292,7 +292,7 @@ class VideoContentSetup { } initPlyr(content: VideoContent) { - if (content.plyr) return; + if (content.plyr || !content.videojs || !content.element) return; content.videoElement = content.videojs?.el()?.querySelector("video"); if (!content.videoElement) return;