You are not logged in.

1

Monday, March 7th 2016, 11:33am

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

Tuur

Sage

Posts: 3,173

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Monday, March 7th 2016, 1:21pm

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);

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<plugin name="gyro" devices="html5" keep="true"
        url="gyro2.js" 
        enabled="false"
        camroll="true"
        friction="0.0"
        touch_mode="full"
        sensor_mode="1"
        autocalibration="true"
        onavailable=""
        onunavailable=""
        onenable=""
        ondisable=""
        />


there are more 'roads to Rome'..!

Hope it helps.

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

3

Wednesday, March 9th 2016, 7:43pm

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*

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

4

Saturday, March 12th 2016, 9:11pm

Also it only works for tablets and phones. For laptops with gyros it doesn't work at all. Including microsoft book/surface.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Similar threads