mistic100/Photo-Sphere-Viewer

Support Preloading without an html element dependency

Closed this issue · 4 comments

Describe the feature

Preload panoramic buffer data without the need to instantiate the library onto a div element, since the we are flipping pages

Alternatives you've considered

instantiating the library onto a random element and then instantiating it again when needed. However this creates a blocking event when it is pulling from the cache

Additional context

the reason for this is that we are switching different pages with different content and some have no panoramas. So it would be helpful to preload them when we first load all the pages

When you say "switching pages" you are talking about a SPA right ?

"However this creates a blocking event when it is pulling from the cache"
can you elaborate on this ? if it blocks when pulling from the cache, it will happen everytime.

Yes, in a SPA.
We have a "lesson" style where you can go through the pages etc.

I guess that is a good point, that it would still be blocking regardless.
this is what I am doing for the preloading:
image
pano_blocking

When I cache from simply visiting (without the above) it will show the loading screen, here it never shows. Have not found out why yet

I am not sure I understand your last sentence.

Anyway making the loading methods static is kinda difficult, all the code is thighly coupled with the viewer instance, although the Cache is global.

Your current implementation seems sensible. This part of the API should be stable.

OK thank you, I saw it was coupled so figured was a decent effort.

What I meant is there is something happening that when I use the method above the loading screen is non-existent.

When I do not add my custom code, the loading screen will show even when you revisit.

But I will keep looking and I appreciate the swift response.