Hello to all,
I have a website that recently stopped working. The viewer krpano 1.20.9 (build 2020-11-19) is used there. Strictly speaking, the event onloadcomplete is no longer executed. Also no error message appears. The panorama is loaded correctly, but all other operations triggered by onloadcomplete are no longer executed.
So far I have used the following code:
Inside the HTML5
Code
<script>var krpano<?= $this->contentId ?> = new MyKrpanoWrapperClass(); // this is resolved to krpano5896 etc to build an unique variableembedpano( { xml: "{{env::url}}/<?= $this->panoUri ?>", target: "pano_<?= $this->contentId ?>", html5: "auto", mobilescale:1.0, consolelog: !0, passQueryParameters: true, initvars: { viewerDir: '<?= $this->viewerDir; ?>', pluginsDir: '<?= $this->pluginsDir; ?>', skinDir: '<?= $this->skinDir; ?>'}, onready: krpano_onready_callback});function krpano_onready_callback(_interface) { krpano<?= $this->contentId ?>.interface = _interface; krpano<?= $this->contentId ?>.setLookTo(<?= $this->hlookat ?>,<?= $this->vlookat ?>,<?= $this->fov ?>);}<script>
The wrapper class (will be loaded separately) looks like this:
Code
class MyKrpanoWrapperClass{ /******************************************** * * @param panoramaId * @param opt */ constructor(panoramaId, opt = {}) { this.ifc = null; // the krpano interface this.target = document.currentScript.parentElement; // the parent el of the embedded script // more code ... } set interface(krpano_interface) { this.ifc = krpano_interface; // get path references this.viewerDir = this.ifc.get('viewerDir'); this.pluginsDir = this.ifc.get('pluginsDir'); this.skinDir = this.ifc.get('skinDir'); // set callback immediately after initialization this.ifc.set("events.onloadcomplete", this.onLoadComplete.bind(this)); }onLoadComplete() { alert("ready"); } }
Recently, onloadcomplete is no longer running. I cannot find a cause. There are no error messages.
Does anyone have any suggestions??
Best regards Christian