diff --git a/src/components/PsVideo.ts b/src/components/PsVideo.ts index 05e1aec8..1d911183 100644 --- a/src/components/PsVideo.ts +++ b/src/components/PsVideo.ts @@ -214,6 +214,12 @@ class VideoContentSetup { content.videojs.play(); }, 500); + let canPlay = false; + content.videojs.on("canplay", () => { + canPlay = true; + this.updateRotation(content); + }); + // Get correct orientation axios .get( @@ -223,7 +229,10 @@ class VideoContentSetup { ) .then((response) => { content.data.exif = response.data?.exif; - this.updateRotation(content); + + // Update only after video is ready + // Otherwise the poster image is rotated + if (canPlay) this.updateRotation(content); }); } diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 001e2d26..5d657c09 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -469,8 +469,7 @@ export default class Viewer extends Mixins(GlobalMixin) { // Get the thumbnail image this.photoswipe.addFilter("thumbEl", (thumbEl, data, index) => { const photo = this.list[index - this.globalAnchor]; - if (!photo || !photo.w || !photo.h || photo.flag & this.c.FLAG_IS_VIDEO) - return thumbEl; + if (!photo || !photo.w || !photo.h) return thumbEl; return this.thumbElem(photo) || thumbEl; });