This documentation is for a deprecated version. For the latest version, please refer to: [Coming soon]
This API v1.0.0 create a safe cross-origin communication between the VR360+ embeded and the main page via Window.postMessage().
It is in the form of JavaScript library you include in your own code.
<script type="text/javascript" src="https://apps.zondavirtual.com/api/ZondaVR360WebappApiv1.0.0.min.js"></script> Declare an API variable. This will Initialize the cross-origin communication. The variable will be used later for all other function calls.
<iframe id="vr360Iframe" style="height: 100%;width:100%" src="https://apps.zondavirtual.com/vr360/index.html?id=d87e18db-3def-45ac-adb1-b9d4a6d045bc" onload="iframeLoaded(event)"></iframe>The VR360+ link need to be set as the source of the IFrame. The API takes some time to initialize once initialized an event is sent to call back function.
Those marked with* are mandatory.
function iframeLoaded(event)
{
vr360WebApi = new ZondaVR360WebAppApi(document.getElementById("vr360Iframe"),"vr360callbackFunction");
}
IFrame container is undefined. Review the Iframe parameter.
vr360WebApi.getConfigId((e) => {console.log(e)})

Demo URL: https://apps.zondavirtual.com/demo/VR360CommunicationAPI/index.html