From 09ab876ebd9a801c1497bab487b44f3953bda39c Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 19 Mar 2023 01:51:21 -0700 Subject: [PATCH] video: keep placeholder Signed-off-by: Varun Patil --- src/components/viewer/PsVideo.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index 317b7553..c76365a3 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -44,6 +44,10 @@ class VideoContentSetup { lightbox.on("contentDeactivate", this.onContentDeactivate.bind(this)); lightbox.on("contentResize", this.onContentResize.bind(this)); + lightbox.addFilter( + "isKeepingPlaceholder", + this.isKeepingPlaceholder.bind(this) + ); lightbox.addFilter("isContentZoomable", this.isContentZoomable.bind(this)); lightbox.addFilter( "useContentPlaceholder", @@ -462,10 +466,14 @@ class VideoContentSetup { } } - isContentZoomable(isZoomable, content) { + isContentZoomable(isZoomable: boolean, content) { return !isVideoContent(content) && isZoomable; } + isKeepingPlaceholder(keep: boolean, content) { + return isVideoContent(content) || keep; + } + onContentActivate({ content }) { this.initVideo(content); }