video: restore thumb anim

pull/221/head
Varun Patil 2022-11-12 04:01:38 -08:00
parent d1aad8e787
commit d5309942ac
2 changed files with 11 additions and 3 deletions

View File

@ -214,6 +214,12 @@ class VideoContentSetup {
content.videojs.play(); content.videojs.play();
}, 500); }, 500);
let canPlay = false;
content.videojs.on("canplay", () => {
canPlay = true;
this.updateRotation(content);
});
// Get correct orientation // Get correct orientation
axios axios
.get<any>( .get<any>(
@ -223,7 +229,10 @@ class VideoContentSetup {
) )
.then((response) => { .then((response) => {
content.data.exif = response.data?.exif; 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);
}); });
} }

View File

@ -469,8 +469,7 @@ export default class Viewer extends Mixins(GlobalMixin) {
// Get the thumbnail image // Get the thumbnail image
this.photoswipe.addFilter("thumbEl", (thumbEl, data, index) => { this.photoswipe.addFilter("thumbEl", (thumbEl, data, index) => {
const photo = this.list[index - this.globalAnchor]; const photo = this.list[index - this.globalAnchor];
if (!photo || !photo.w || !photo.h || photo.flag & this.c.FLAG_IS_VIDEO) if (!photo || !photo.w || !photo.h) return thumbEl;
return thumbEl;
return this.thumbElem(photo) || thumbEl; return this.thumbElem(photo) || thumbEl;
}); });