Go Back   Forums > Talk > General FPP Discussion

Thread Tools Display Modes
Old 09-09-2011, 03:14 PM
regauser regauser is offline
Junior Member
Join Date: Mar 2010
Posts: 13
Downloads: 1
Uploads: 0
Default Is there a way to interrupt loadPano e.g. from Javascript?

Hi all

I hope someone can help me.

I have a webpage where after the initial pano has loaded, subsequent panos are loaded by a user clicking html buttons which run a javascript function with a loadPano in it. The javascript function also changes a title on the page, so the user knows what s/he's looking at.

I'm bumping into the following problem:
- the page loads pano 1.
- the user clicks the button for pano 2.
- but then before pano 2 has loaded or finished its transition, for whatever reason, s/he clicks the button for pano 3.
- the user sees the page title change to pano 3.
- but pano 2 finishes loading in, and pano 3 never loads.

Clearly, this doesn't look good from the user's perspective.

I've read in the forum that while a loadPano request is being executed, it ignores a second one. Is there any reason why the player should ingore the second request? I can't think why it wouldn't make sense to let the second instruction take over. Does anyone know if a newer version of hotspots.swf does allow a second loadPano to stop the first?

So, for the above example, is there any way to interrupt the loadPano for pano 2, and tell it to preferably a) stop loading the file altogether, or at least b) stop the transition, so that I can then send the second loadPano and it will load pano 3?

Can this interruption be done from within my javascript function?

I've tried putting...
...before my...
window.document.pano.myidPanoExecute('loadPano(panoName=images/' + panoName + ')');
... to disable loading, then re-enable it again, but this hasn't worked. Maybe my syntax for disabling and re-enabling is incorrect?

If it's any help, I have attached 2 versions of a basic example below, the only difference is that version one uses the default time for loadPano transition effect of 1 second, and the second one uses 0 seconds.

If the loadPano can't be interrupted or stopped, then I think there could be two ways forward:

1) Don't run the loadPano for pano 3 until it is detected by javascript that pano 2 has finished loading and transitioning. Does anyone know if there's a way to query the player from javascript for whether the player is currently executing a loadPano? I could then use javascript's setInterval to keep looping until that state had changed, before running the loadPano for pano 3.

2) Do something on the hotspot plugin's onTransitionEnd event, but in a way that recognises to only do it when a user has clicked to load another pano.

Does anyone have any thoughts?

Thanks very much for taking the time to read my post, even if you can't help.

Reply With Quote

disableloading, javascript, loadpano

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT. The time now is 07:57 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.