Is it possible to have gyro2 work without needing to press the button first, if the viewer can detect gyro availability and is full-screen.

  • Hi, first post, but loving krpano, Sorry if this has been asked before but I can't find an answer.

    Is it possible to have gyro2 work without needing to press the button first, but only if the viewer can detect gyro availability and is already full-screen.

    Ideally, I would like the user not to have to find and press the button if the conditions are right for the gyro to work. I would prefer them to turn it off rather than turn it on basically. But if there is no accelerometer it functions as normal, not showing the gyro button.

    I'm not really so good at scripting but I am trying to learn. I'm using krpano-1.19-pr3, any help would be much appreciated.

    Thanks in advance *smile*

    Quil

  • Hi,
    yes that is possible.
    Set enabled to true.
    Make also the button show only when available.. by for example put in the onavailable: set(layer[btn_gyro].visible,true);

    there are more 'roads to Rome'..!

    Hope it helps.

    Tuur *thumbsup*

  • Thanks, I was struggling with the plugin actually loading, which is why the enabled switch wasn't having any impact. (I thought that 'enabled' was that function and had already enabled it but couldn't understand why it didn't work)
    so had to change the plugin URL to url="%SWFPATH%/plugins/gyro2.js" and then it started to work as expected.

    I'm really new to this and haven't much time to go through all the instructions!

    Thanks for your help, all working great now. *smile* *smile* *smile* *smile*

  • Is there a way to make it work for Apple devices?
    It works on my Android phone, but on a iPhone it does not work (I have to starting it manually by hitting the gyro button. Then a browser messages appears and asks if it's ok to enable gyro).

    Edit 1:
    I tried to "trigger" it via the events element:

    Code
    <events name="skin_webvr_and_gyro_events" keep="true" devices="html5"
    	        onxmlcomplete="skin_set_webvr_or_gyro_startup_view()"
    	        onresize.mobile="skin_webvr_act_as_gyro_in_portrait_mode();"
    	        onloadcomplete="delayedcall(0.5, 
    				if(webvr.isenabled AND scene.count GT 1 AND skin_settings.webvr_prev_next_hotspots, set(hotspot[skin_webvr_prev_scene].visible,true); set(hotspot[skin_webvr_next_scene].visible,true); );
    				set(plugin[skin_gyro].enabled, true);
    				);"
    	        onviewchange=""
    	        />

    But this doesn't work either.
    Is there a way to really trigger a button (did not find anything about in the documentation)?

    Kind regards
    Alain

    Edited once, last by Alain (July 1, 2020 at 5:51 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!