diff --git a/src/components/viewer/PsImage.ts b/src/components/viewer/PsImage.ts index c38317d1..2588c28d 100644 --- a/src/components/viewer/PsImage.ts +++ b/src/components/viewer/PsImage.ts @@ -10,6 +10,7 @@ export default class ImageContentSetup { initLightboxEvents(lightbox: PhotoSwipe) { lightbox.on("contentLoad", this.onContentLoad.bind(this)); + lightbox.on("contentLoadImage", this.onContentLoadImage.bind(this)); } onContentLoad(e) { @@ -32,4 +33,9 @@ export default class ImageContentSetup { }; }); } + + onContentLoadImage(e) { + if (isVideoContent(e.content) || isLiveContent(e.content)) return; + e.preventDefault(); + } }