|
|
Quellcode |
1 2 3 4 5 |
embedpano({..., xml:null, onready:function(krpano)
{
krpano = krpano.get("global");
krpano.actions.loadxml("...");
}});
|
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 ?
![]()
Hi Klaus,Hi,
running without xml is possible, here an example:
![]()
Quellcode
1 2 3 4 5embedpano({..., 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
|
|
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}});
|
|
|
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); }});
|
|
|
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) |
|
|
Quellcode |
1 |
<script id = "krpanoxmlcode" type = "text / xmldata"> ... </script> |
|
|
Quellcode |
1 |
<script src = "krpano.js"> </script> |
|
|
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 ...
|