krpano WebVR plugin enable

693 views Asked by At

I need to implement to existing project WebVR plugin. I have main krpano.xml file which is pointing to krpano skin file.

I added plugins folder which has webvr.xml and webvr.js files with some other files too.

Inside krpano skin.xml file I added:

<include url="plugins/webvr.xml" devices="html5" />
<plugin name="WebVR" mobilevr_fake_support="true" />

And inside navigation layer I added:

<layer name="btn_vr" x="300" url="down.png" crop="0|0|38|38" onclick="enterVR()"/>

I'm not getting any plugin errors in my console but clicking on button nothing happens. I would like to get effect like on this example: https://krpano.com/tours/corfu/ where there is a cardboard icon in navigation and clicking on it vr is opened.

Any idea what I'm doing wrong with this?

2

There are 2 answers

2
MR.Alpha On

Your xml property probably is not complete. try these.

0
Mahesh Panthi On

This might be because of path related issue. You can try this:

<include url="%SWFPATH%/plugins/webvr.xml" devices="html5" />
<plugin name="WebVR" mobilevr_fake_support="true" />

And inside navigation Layer:

<!-- skin_base - the base skin image -->    

<style name="skin_base" url="calc:vtourskinxmlpath.url + skin_settings.design_skin_images" />       

    <!-- skin_glow - button glowing (if additional ondown,onup,onout,over events are needed, this style provides ondown2,onup2,onover2,onout2 events) -->
            <style name="skin_glow"
                   ondown="copy(skin_lockglow,name); skin_buttonglow(get(name)); if(ondown2, ondown2() );"
                   onover="if(skin_lockglow === null, copy(skin_lockglow,name); skin_buttonglow(get(name),0.3) ); if(onover2, onover2() );"
                   onout="if(skin_lockglow === name AND !pressed, skin_buttonglow(null);delete(skin_lockglow); ); if(onout2, onout2() );"
                   onup="if(onup2, onup2()); delayedcall(0, if(hovering AND enabled, skin_buttonglow(get(name),0.3); , skin_buttonglow(null);delete(skin_lockglow); ); );"
                   />

    <layer name="skin_btn_vr" style="skin_base|skin_glow" crop="0|0|80|64"    align="center" x="+146" y="0" scale="0.5" onclick="webvr.enterVR();" visible="false" />