You are not logged in.

1

Monday, October 20th 2014, 8:34pm

Unexpected Behavior: Using loadpano and loadxml Causes the Screen to go Black

Hello Klaus,

When I make a call to loadpano or loadxml I get a black screen - it's as if the pano is unloaded. However, the hotspots are still visible. I only expected screen rendering for loadscene - so am I missing something? I apologize if this is really obvious *unsure*

BTW, I do not want to show and load progress graphics. So I'm using...

<progress showload="none" showwait="none"></progress>

Thanks again for all your amazing work!

Keno

2

Monday, October 20th 2014, 8:53pm

Hi,

sorry, but without example or link it's not possible to say anything of course.

Best regards,
Klaus

3

Monday, October 20th 2014, 10:16pm

Sure...

Instead of loading all the panos in my tour I want to load only the panos connected to my current pano. This is to decrease overall load time. So after the first scene is loaded, I execute this JavaScript code...

Source code

1
2
3
4
        	$.ajax({            type: "GET",            url: "next_scene.xml",            dataType: "text",            context: { krpanoObject: krpanoObject },            error: function(xhr, status, error) {                console.log("ERROR: ");            },            success: function(result, status, xhr) {                var action = "loadxml('" + htmlEscape(result) + "', null, MERGE | KEEPSCENES | KEEPHOTSPOTS | KEEPPLUGINS, BLEND(2))";
                console.log("KrPano: " + action);                this.context.krpanoObject.call(action);            }
        });
        var htmlEscape = function(str) {            return String(str)                .replace(/&/g, '&amp;')                .replace(/"/g, '&quot;')                .replace(/'/g, ''')                .replace(/</g, '&lt;')                .replace(/>/g, '&gt;');        };



...before this code is executed, I can see the scene ok. Once onxmlcomplete fires, the scene goes black, leaving the hotspots behind.
The thought then is that when I'm going to transition to the next pano after clicking on a hotspot, that pano's code is already loaded and all I have to do is call loadscene.

BTW calling loadpano instead of loadxml has similar behavior.

Some other questions arise:
- Do I have to call loadscene after loadpano and loadxml?
- Does loadxml have the same effect as loadpano?

Thanks again for the quick response...you rock!

4

Tuesday, October 21st 2014, 11:21am

Hi,

what's the content of the loaded xml?
Is there a pano image defined or just scenes?
If there are just scenes, then an additional loadscene() call would be required of load one of these.

Please note that a <scene> is just like an inlined xml and that they will not get loaded 'automatically':
http://krpano.com/docu/xml/#scene

Best regards,
Klaus

5

Friday, October 24th 2014, 6:57pm

Thanks Klaus.


I apologize for the late reply.


I've narrowed down my black screen issue to this...


After my initial call to loadpano followed by loadscene, I make a subsequent call to loadpano followed by loadscene followed by wait(BLEND) when the transition hotspot is clicked. I see the black screen (for about a second) just before the new scene loads. I am using the BLEND option for both loadpano and loadscene. Also, I do not want to have any loading gifs.


Is that supposed to happen or am I doing something wrong?


Thanks again for all you help,


Keno

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

6

Monday, October 27th 2014, 10:48am

Yes I've also a black transition on a project where I use the loadpano to load an XML file from a JS/JSON script then use loadscene to use scene informations which are into the loaded XML file.

XML code is :

Source code

1
2
loadpano(%FIRSTXML%/../tiles/%1.xml, NULL, MERGE|KEEPVIEW, NOBLEND);
loadscene(%1, NULL, MERGE|KEEPVIEW, NOBLEND);


Probably not the best way to do that, but I have usage of the <scene> tag of each new panorama.

7

Monday, October 27th 2014, 11:24am

Hi,

The HTML5 viewer can currently only blend between TWO panos. When directly loading a scene after the xml, then this is the third pano and when the xml itself has no pano image defined, then this is just black.

Btw - have you already tried using version 1.18?

Best regards,
Klaus

8

Monday, October 27th 2014, 3:23pm

Thanks benji33 for adding and thanks Klaus for your response.

As I understand it there are two ways to load krpano xml into memory: loadxml and loadpano. Calling loadscene then puts the specified scene into the current context and makes the pano visible (in my case every scene has a pano image).

In my example and I think that of benji33, we call loadpano to load the pano into memory and then we are calling loadscene to:
- now put the scene (in the xml returned by the loadpano call) into current context
- display the pano image

So in this case there is no third pano - are we missing something?

I assumed that loadscene just loads from memory, is that assumption wrong?

I'm using 1.17.4, does 1.18 fix the black screen issue?

Thanks again,

Keno

9

Monday, October 27th 2014, 3:31pm

Hi,

loadpano(), loadxml() and loadscene() are ALL the same - only the source of the xml code is different:
  • loadpano() will load the xml from a file
  • loadxml() will load the xml from a string
  • loadscene() will load the xml from a <scene> element
Regarding 'in memory' - there will be always only ONE pano image in memory.


I'm using 1.17.4, does 1.18 fix the black screen issue?
Please just try it, it can help here.

Best regards,
Klaus

10

Monday, October 27th 2014, 6:00pm

So, which of these three actions changes what's displayed on the screen? My assumption is that only loadscene changes what's displayed.

Thanks,

Keno

11

Tuesday, October 28th 2014, 10:29am

Hi,

all three are the same and changing the current pano - see above: 'only the source of the pano xml is the different'.

A <scene> is like an inline embedded xml file.

Best regards,
Klaus

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

12

Tuesday, October 28th 2014, 3:18pm

On my personal project 1.18 doesn't help to solve the black screen due to the third pano. So perhaps one day a loadscenefrompano() which merge loadpano and loadscene or loadscenefromxml() which merge loadxml and loadscene.
Is there an other way to do something which use <scene> tags and dynamic content ?

13

Wednesday, October 29th 2014, 7:34pm

So perhaps one day a loadscenefrompano() which merge loadpano and loadscene or loadscenefromxml() which merge loadxml and loadscene.
Such action is already on my list ;-).

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

14

Thursday, October 30th 2014, 2:10pm

Good to know. thanks.