Disabling autorotate after user interaction

  • Hi there

    I'm creating a virtual tour, and I would like the camera to start rotating right after the panoramic photo loads, but not to rotate after the user moves it.
    I tried executing the following action at onstart:


    <action name="init">
    set(autorotate.waittime,0);
    set(autorotate.enabled,true);
    delayedcall(1,set(autorotate.waittime,-1))
    </action>

    But unfortunately it didn't work, as 1s after start the camera stopped rotating, even without any user interaction. Is there some way to work around this? I'm thinking of adding an invisible plugin and capturing the onclick action, but it's not very elegant and probably won't work if the keyboard is used for control.

    Thanks
    Manuel

  • Thanks a lot for such quick responses :)

    The onclick worked! But I couldn't find that event in this part of the docs: https://krpano.com/docu/xml/#events . Is there some other place where I can get a list of all the available events?

    Sorry, I didn't understand the "oninterrupt" suggestion. I tried creating an <event oninterrupt ... /> with <autorotate/> defined as normal, which didn't disable the autorotate; and I also tried this:

    <krpano version="1.0.8" onstart="oninterrupt(set(autorotate.enabled,false)),set(autorotate.waittime,0);set(autorotate.enabled,true);">


    In this case the camera didn't start rotating. Did I mess something up, or were you suggesting something else?

  • the below code should work. however after a quick test it did not. i dont have time to test more tonight. maybe an issue with 1.0.8 beta 9, try an older version i searched the forums and this seems to be the correct code.

    <events oninterrupt="set(autorotate.enabled,false);>

    <autorotate enabled ="true"
    waittime="1.5"
    accel ="1"
    speed ="10"
    horizon ="0"
    tofov ="NaN"
    />

  • In case anyone still needs this, I did like this:

    Using this, the panorama will start to auto-rotate after 6 seconds, but when the user drags it herself, it will only auto-rotate again after 20 sec.

    - Ronny D'Hoore

  • that doesnt work for me - but iam still searching for something like this.-


    autrotate till user interact - than wait and set up for autorotate-
    so if user pressed video or slidshows the autorotation will stop

    but after a period of non inteactivity the autrotation will start ???

    does anybody know?

  • Here is a much simpler code. Of course you do not need to set different settings for autorotate for different devices.
    This is just a demo that you can do that also, Especially speed settings needs to be different.


    <events onmousedown="set(autorotate.enabled,true);set(autorotate.waittime, 15);" />

    <autorotate devices="desktop" enabled="true"
    waittime="3.0"
    accel="1.5"
    speed="4"
    horizon="0"
    tofov="110"

    />

    <autorotate devices="mobile" enabled="true"
    waittime="1.0"
    accel="1.5"
    speed="16"
    horizon="0"
    tofov="120"

    />

    <autorotate devices="tablet" enabled="true"
    waittime="1.0"
    accel="1.5"
    speed="7"
    horizon="0"
    tofov="110"

    />


    Hans

Participate now!

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