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

  • 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...

    Code
    $.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!

  • 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

  • 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 :

    Code
    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.

  • 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

  • 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

  • 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

  • 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 ?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!