Hello everyone,
Thank you very much in advance for helping.
One if my clients have asked if it would be possible to send an event from krpano so they can listen to it and this way know when a new scene has been loaded. This event also should send the scene name or any kind of information to identify this new scene.
So I've spent a good hour on this but I'm definitely stuck.
The virtual tour uses the latest Beta version
krpano 1.19-pr3 (build 2015-08-04)
So I thought It would be good use javascript directly like this:
|
Source code
|
1
2
|
<action name="new_event" type="Javascript" devices="html5"><![CDATA[
]]></action>
|
My client said that if I can create an event like using:
|
Source code
|
1
|
var event = new Event("zoneChanged");event.zone = 2;document.dispatchEvent(event);
|
Then they can listen to it:
|
Source code
|
1
2
3
|
document.addEventListener("zoneChanged", function (event) {
console.log(event.zone);
});
|
I have no experience with Krpano and the JS interface. I know that t
he information about the scene can be supplied by using
|
Source code
|
1
|
get(xml.scene)
|
But I haven't managed to get the right commands/syntax to export an event.
Thanks