Krpano without XML

  • Good Morning,

    In 2016 I implemented a project with Krpano as an html5 version and now want to revive this project, but completely without XML.

    I have already seen LoadXML, but unfortunately I only get a white page (embededpano xml = ““). The XML string is really heavy with a total of 3800 lines of code, but there is no other way if you want to do without all XML files, right?

    Is it even possible to run Krpano with plugins completely without XML?

    Thanks for your support :)

    Best regards and have a nice weekend

  • Hi,

    running without xml is possible, here an example:

    Code
    embedpano({..., xml:null, onready:function(krpano)
    {
      krpano = krpano.get("global");
      krpano.actions.loadxml("...");
    }});

    But when merging all the xml files into one string, it can be necessary to escape several characters and adjust some file paths.

    Btw - see also this example - it shows how to embed the xml into the html file and load it from there:
    https://krpano.com/docu/localusage/#embeddingallfiles

    Best regards,
    Klaus

  • out of interest... whats the goal of that ?
    krpano runs in the browser, so also with LoadXML you somehow need to pass an XML
    and if you load other files (plugins) as well.. why not an xml ?
    *confused*


    Hi,


    thanks for your response.


    XML files are not allowed in the CMS system in which the KRPano is to be used. I don't know why, but it's just not allowed *wacko*

  • Hi,

    running without xml is possible, here an example:

    Code
    embedpano({..., xml:null, onready:function(krpano)
    {
      krpano = krpano.get("global");
      krpano.actions.loadxml("...");
    }});

    But when merging all the xml files into one string, it can be necessary to escape several characters and adjust some file paths.

    Btw - see also this example - it shows how to embed the xml into the html file and load it from there:
    https://krpano.com/docu/localusage/#embeddingallfiles

    Best regards,
    Klaus

    Hi Klaus,

    Thank you for your help.
    Unfortunately, the variants do not work.

    Neither like this:

    Code
    embedpano({id: "panoSWFObject",xml: "",bgcolor: "# FFFFFF",target: "spinPlayer",html5: "always",wmode: "window",passQueryParameters: true, onready: function(krpano){var krpano2 = krpano.get("global");var xmlstring = document.getElementById("krpanoxmlcode").innerHTML;krpano2.actions.loadxml(xmlstring);
    console.log(krpano2); // show NULL}});

    as well as like this:

    Code
    embedpano({id: "panoSWFObject",xml: "",bgcolor: "# FFFFFF",target: "spinPlayer",html5: "always",wmode: "window",passQueryParameters: true, onready: function(krpanoJSinterface)    {      var krpano = krpanoJSinterface.get ("global");console.log (krpano);      var xmlstring = document.getElementById("krpanoxmlcode"). innerHTML;console.log(krpano); // << shows NULL      krpano.actions.loadxml(xmlstring);  }});

    console.log only shows NULL and I get this error in the console:

    Code
    Uncaught TypeError: Cannot read properties of null (reading 'actions')    at Object.onready (preload.js: 628)    at De.jd.init (eval at embedpanoJS (player.js: 11), <anonymous>: 1: 167278)    at embedhtml5 (eval at embedpanoJS (player.js: 11), <anonymous>: 1: 167806)    at embedpanoJS (player.js: 13)    at o (player.js: 5)    at dt (player.js: 5)    at Object.e.embed (player.js: 5)    at embedpano (player.js: 5)    at startplayer (preload.js: 615)    at getNodes (loadXML.js: 426)

    the entire XML code is now in the index.html in:

    Code
    <script id = "krpanoxmlcode" type = "text / xmldata"> ... </script>

    What confuses me a bit is that this file is included in the example:

    Code
    <script src = "krpano.js"> </script>

    but we only have these files:

    krpanoiphone.license.js
    loadXML.js
    player.js
    preload.js
    showMenu.js

    and in the plugins folder:

    abs.js
    gyro.js
    gyro2.js
    moretweotypes.js
    radar.js
    scrollarea.js
    soundinterface.js
    videoplayer.js

    I suspect krpano.js is the player.js file correct with us?

    In this I find two minified source codes:

    Code
    / *krpano Embedding Scriptkrpano 1.18.3 (build 2015-03-05)* /function createPanoViewer ...
    and
    / *krpano HTML5 Viewerkrpano 1.18.3 (build 2015-03-05)* /var krpanoJS = {version: "1.18.3", build: "2015-03-05"};function embedpanoJS ....
    and at the end:
    embedhtml5 (e.params, "krp: m2 ...

    Do you have any idea what is going wrong here?

    Thank you for your efforts and have a nice Sunday.

    Best regards

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!