flipbook-vue icon indicating copy to clipboard operation
flipbook-vue copied to clipboard

Next pages show current page instead of loader when flipping

Open mediavrog opened this issue 2 years ago • 8 comments

Version: 1.0.0-beta.4 used with VueJS3 inside nuxt

Steps to reproduce:

  • create flipbook with >10 images/pages
  • flip quickly between pages when network is weak (mobile or developer tools network speed throttling)
  • notice that the image on page being flipped appears briefly (as long as it takes to load it) as the next page
<template>
  <div>
    <client-only>
      <flipbook
          class="flipbook"
          :pages="images"
          :pagesHiRes="imagesHq"
          gloss="0.5"
      ></flipbook>
    </client-only>
  </div>
</template>

What I expected:

  • during loading, I'd expect a blank page with the loading indicator

Will attach a video

mediavrog avatar Jan 23 '23 02:01 mediavrog

https://user-images.githubusercontent.com/160785/213959510-e4ac2f94-8bf7-4d50-be1c-382c016c8fb8.mp4

mediavrog avatar Jan 23 '23 03:01 mediavrog

@mediavrog that use case looks great. How did to worked with opensea? The image src points to html page with flipbook?

kabaluyot avatar Jan 24 '23 12:01 kabaluyot

@mediavrog that use case looks great. How did to worked with opensea? The image src points to html page with flipbook?

animation_url is used. Html and assets need proper CORS then all works well

mediavrog avatar Jan 28 '23 12:01 mediavrog

I tried it on my demo page and was able to reproduce it on Chrome's slow network emulation, but not on an Android machine on a very slow network with Wi-Fi turned off.

Flipbook-vue loads the same image URL in advance with new Image and then after onload actually uses it in <img>, background-image etc. This means that if caching is properly enabled on the browser side, this problem will not occur. Conceivably, the server on which you are hosting the image does not allow caching properly?

ts1 avatar Jan 29 '23 09:01 ts1

Screenshot 2023-01-29 at 21 56 13

I set cache to one week and headers look alright. I wonder if an iframe could somehow interfere with this.

mediavrog avatar Jan 29 '23 20:01 mediavrog

Ok I also noticed the issue occurs mainly if I disable caching in the network console. But shouldn't the flipper show the loading svg in that case and then the image?

mediavrog avatar Jan 29 '23 21:01 mediavrog

It should, but since it is difficult to manage strictly, it treats URLs as cached once they have been loaded successfully.

ts1 avatar Jan 30 '23 08:01 ts1

I see. A proper caching inside the plugin would resolve this then..

mediavrog avatar Jan 31 '23 10:01 mediavrog