Sie sind nicht angemeldet.

1

Freitag, 24. September 2021, 08:12

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

juyatu

Schüler

Beiträge: 68

Wohnort: China

Beruf: Krpano custom coding

  • Nachricht senden

2

Freitag, 24. September 2021, 09:53

If you lose a large chunk of your code file, consider doing it all over again.
*thumbup*

Preload Plugin (Free, source code)
Constrast Plugin
KR HLS Plugin
Slider Controller Plugin
KR+Next+MapBox+TS Demo (source code)


微信:Eric_Chen1990

3

Freitag, 24. September 2021, 17:24

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*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »indexofrefraction« (24. September 2021, 21:58)


4

Freitag, 24. September 2021, 19:11

Hi,

running without xml is possible, here an example:

Quellcode

1
2
3
4
5
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

5

Freitag, 24. September 2021, 21:59

@ klaus:

just to know... i guess you can pass an encrypted xml (string) as well ?

6

Sonntag, 3. Oktober 2021, 17:59

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*

7

Sonntag, 3. Oktober 2021, 18:14

Hi,

running without xml is possible, here an example:

Quellcode

1
2
3
4
5
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:

Quellcode

1
2
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:

Quellcode

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

Quellcode

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

Quellcode

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


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

Quellcode

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

Quellcode

1
2
3
4
5
/ *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

8

Sonntag, 3. Oktober 2021, 20:51

Hi,

your krpano version '1.18.3 (build 2015-03-05)' is way too old!
Use the current one.

Best regards,
Klaus

9

Montag, 4. Oktober 2021, 07:00

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

then simply rename them to html?