Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Montag, 11. Januar 2010, 19:25

How to preload panorama source images?

I've seen mentions of this before and I have a feeling I'm just being a bit slow...

But how do I code the XML to get a set of cubefaces for a pano preloaded when I open a different one?
For example, pano 'A' has hotspot links to pano 'B' and pano 'C'. How do I get the cubefaces for panos 'B' and 'C' to be preloaded when someone visits pano 'A'?

k

2

Dienstag, 12. Januar 2010, 15:16

Hi,

there is no direct preloading support in krpano at the moment,

the only thing you could do at the moment is to 'preload' the image manually ,
either via javascript or via krpano actions,

e.g. like this - load an image as hidden plugin:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<action name="preloadimage">
  <!-- 1. parameter = internal ID,  2. parameter = url -->
  addplugin(pre_%1);
  set(plugin[pre_%1].visible, false);
  set(plugin[pre_%1].onloaded, trace(preload %2 done);removeplugin(pre_%1) );
  set(plugin[pre_%1].url, %2);
  trace(starting preloading %2);
</action>

<action name="preloadpano1">
  preloadimage(pano1_l, pano1/cube_l.jpg);
  preloadimage(pano1_f, pano1/cube_f.jpg);
  preloadimage(pano1_r, pano1/cube_r.jpg);
  preloadimage(pano1_b, pano1/cube_b.jpg);
  preloadimage(pano1_u, pano1/cube_u.jpg);
  preloadimage(pano1_d, pano1/cube_d.jpg);
</action>

<events onloadcomplete="preloadpano1();" />


best regards,
Klaus

bulp

Fortgeschrittener

Beiträge: 390

Wohnort: Malaysia

  • Nachricht senden

4

Mittwoch, 13. Januar 2010, 06:22

can we do the same with multiresolution images?

5

Mittwoch, 13. Januar 2010, 13:40

can we do the same with multiresolution images?
not automatically
you would need to set all wanted tiles manually...

6

Montag, 18. Januar 2010, 12:51

the only thing you could do at the moment is to 'preload' the image manually ,
either via javascript or via krpano actions
Thanks for the info Klaus, and especially for the suggested example. I'm afraid my stupidity seems to have caught up with me again - I implemented this like so:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<action name="preloadimage">
<!-- 1. parameter = internal ID, 2. parameter = url -->
  addplugin(pre_%1);
  set(plugin[pre_%1].visible, false);
  set(plugin[pre_%1].onloaded, trace(preload %2 done);removeplugin(pre_%1) );
  set(plugin[pre_%1].url, %2);
  trace(starting preloading %2);
</action>

<action name="preloadpano1">
  preloadimage(pano1_l, five/five_l.jpg);
  preloadimage(pano1_f, five/five_f.jpg);
  preloadimage(pano1_r, five/five_r.jpg);
  preloadimage(pano1_b, five/five_b.jpg);
  preloadimage(pano1_u, five/five_u.jpg);
  preloadimage(pano1_d, five/five_d.jpg);
</action>

<events onloadcomplete="preloadpano1();" />


The images I need to preload are in a folder called "five" and the images are named "five_l.jpg", etc.
The Status bar (bottom of the browser window) in Firefox shows "Transferring data from www.panoramaphotographer.com" when I load the page/XML with this code. However, this never changes, and Activity Monitor shows no significant network activity. When I click the hotspot link to go to the next pano, the one that should be preloaded, it loads at the normal un-cached speed. When I then go back and try again it loads fast, because I've now been there and it *is* cached.

What's the simplest possible way to code this? I don't need to worry about tracing to see if it is done, I just want it to preload in the hope that the visitor waits long enough and ends up with a smoother, quicker step to the next pano.

Thanks!

Keith

7

Montag, 18. Januar 2010, 21:07

Hi thatkeith,

Perhaps a path issue...The ones on your example are, by default, relative to first loaded XML path... Just an idea, try adding %SWFPATH% placeholder in your paths...

Quellcode

10
11
12
13
14
15
16
17
<action name="preloadpano1">
  preloadimage(pano1_l, %SWFPATH%/five/five_l.jpg);
  preloadimage(pano1_f, %SWFPATH%/five/five_f.jpg);
  preloadimage(pano1_r, %SWFPATH%/five/five_r.jpg);
  preloadimage(pano1_b, %SWFPATH%/five/five_b.jpg);
  preloadimage(pano1_u, %SWFPATH%/five/five_u.jpg);
  preloadimage(pano1_d, %SWFPATH%/five/five_d.jpg);
</action>


Hope this can help...

SAlut.

8

Montag, 25. Januar 2010, 22:57

Perhaps a path issue...
Hi Michel,

Thanks for the help. Unfortunately it didn't make any difference. All the XML files are at the same level, and so is the krpano.swf file. I've also tried dumping the images out into the same directory as everything else and altering the paths everywhere to match. But no, it still loads from scratch when I first try clicking the hotspot to the second place, then faster when I navigate back and try again.

The images referred to in both the preloader trick and the second XML file are definitely the same...

Erm... are there any other ways to try forcing a preload? Or anything more I can try with this code? I don't need to monitor for when it is done or any sophisticated stuff like that, just attempt to get something loaded before the user gets around to clicking and having to wait.

k

9

Montag, 25. Januar 2010, 23:03

Hi thatkeith,

Can you give a link to see what is happens ??

10

Dienstag, 26. Januar 2010, 01:48

Yes, of course - should have done this before!

http://www.panoramaphotographer.com/lcc/tour/

I've been trying to preload the cubefaces for the pano just through the swipecard gates, heading into the college...

Keith

11

Dienstag, 26. Januar 2010, 02:10

Hi keith,

The krpano debugger returns:

Quellcode

1
2
3
4
5
INFO: krpano 1.0.8 beta 6 (build 2009027)
INFO: Flashplayer WIN 10,0,42,34 PlugIn
INFO: registered to: Keith Martin
INFO: unknown action command: preloadpano1
INFO: unknown action command: preloadpano1

So, the action does not execute... Do not know why...
Try action(preloadpano1); instead of preloadpano1();

Quellcode

1
<events onloadcomplete="action(preloadpano1);" />


SAlut.

12

Dienstag, 26. Januar 2010, 02:36

Hi keith,

I have tried the code with krpano 1.0.8 beta9 and it work....
I think the problem is the version your are using (krpano 1.0.8 beta 6)
Direct call to an action exist only since krpano 1.0.8 beta 8:
user defined actions <action> can now be called "direct"
e.g. instead of:

Quellcode

1
action(actionname, parameters...);

now also just:

Quellcode

1
actionname(parameters...);

is possible
SAlut.

13

Dienstag, 9. Februar 2010, 23:55

Thanks Michel, you've certainly spotted something I should have fixed before now! I've upgraded krpano.swf to b9.

I'm still a bit in the dark about what's happening; the preloading doesn't seem to be working even now, although I admit I'm probably beginning to confuse myself through code tweaks back and forth.

The XML files are all at the same level, and I've done the same with the images for the test. (And the XML file that uses those images. :-) But it seems to load as slowly as others when I empty the browser cache and start fresh, then quickly when I navigate back and try again without emptying the cache.

Would it be possible to simplify the original script? Does it need all the parts that were suggested? Or is there a bit of the documentation I should read to understand this better?

(Sorry!)

k

14

Mittwoch, 10. Februar 2010, 02:34

Hi Keith,

Your code is working properly now ;-) ... The preloadpano1() action works correctly and your cube face images are cached as expected...
I think you are confused because Firefox displays that it makes a connection and transfer some data... like if it is loading ALL the files needed for the next pano... BUT IT IS NOT LOADING ALL THE FILES... IT ONLY LOADS THE XML FILE ( 5inside-gates.xml ) THAT IT IS NOT CACHED YET...The cube face are already cached, so, they do not are reloaded and the pano is showed more quickly *smile* ...

(edited)One note: you are calling the action twice inside your 7reception.xml....
on the onstart :

Quellcode

1
<krpano version="1.0.8" onstart="set(doturnview,no); preloadpano1();.....

and on the onloadcomplete :

Quellcode

1
<events onloadcomplete="preloadpano1();" />

That is not a real problem.. only that it is executed 2 times...

SAlut...

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »michel« (10. Februar 2010, 03:43)


15

Donnerstag, 11. Februar 2010, 01:11

Your code is working properly now ;-) ... The preloadpano1() action works correctly and your cube face images are cached as expected...
Michel, you're right! Thanks, I think I managed to juggle things back to a working state without realising! Too much reloading must have fried my perceptions...

Okay, I'm beginning to get this. Great stuff. And thanks! :-)

k

I fixed the double call too. Heh.

Beiträge: 148

Wohnort: Italy

Beruf: Freelance Fotographer

  • Nachricht senden

16

Donnerstag, 19. Dezember 2013, 15:25

can we do the same with multiresolution images?
not automatically
you would need to set all wanted tiles manually...
with 1.17 pre-release? is something changed?