Call an action at a specific video time

  • Hi Klaus,

    I am trying to call an action at a specific time after a video has been started. In an older thread, you posted this loop

    XML: 1
    <action name="checkvideotime">
      trace('video time=',plugin[video].time);
      if(plugin[video].time GT 5, action(...));    
      ...
      delayedcall(1.0, checkvideotime() );
    </action>

    For me it is imortant to use this loop with an is equal operator ==, however this doesn´t seem to work.

    I have changed this a little but it still only works with a GT operator, not with == or ===. My code looks like this:

    XML: 1
    <action name="eventstarter">
      copy(plugin[video].time);
      if(plugin[video].time == 5, blendinspot(hs1) ); 
      delayedcall(1.0, eventstarter() );
    </action>

    Why does it only work with GT?
    Thank you very much for your help *smile*

    Thomas

  • Hi,

    Try:

    if((plugin[video].time GT 5) AND (plugin[video].time LT 6) , action(...));
    Then the action will be triggered in that second of the video.

    maybe first 'roundval' the video time.

    Hope it helps!


    Tuur *thumbsup*

  • Hi Tuur,

    thank you so much for the quick reply. *thumbsup* I tried the code you sent me but it still does not work.
    Maybe i am doing the roundval of the video time wrongly. How exactly would i do this.
    This is a bit new to me.

    The thing i am trying is that i want to have a hotspot appear at a specific time and accompany this by a sound (ding).
    If i do not limit the action to an exact second, using GT will have the sound repeat over and over again.

    Thank you,

    Cheers
    Thomas

  • Hi Guys

    Don't mean to crash this thread, but looks like I'm trying to do something similar...

    I've got a number of hotspots which I want to control when they appear, ie hotspot-1 visible from 0 to 15 sec, hotspot-2 visible from 13-20 sec, hotspot-n visible from 90 to 110 sec, etc. I'm assuming I can pre create them and set them all to not be visible then depending on the time turn some on. Reason for doing this is I have a 360 video with a presenter 'curating' the room so I only want hotspots to appear on the items she is talking about, then to turn off again as she moves around the room.

    Is there an easy way to code this?

    cheers

    Tim


    ps - Tuur I will have a look at your plugin too *smile*

  • HI Everybody,

    I did it like this, with Tuurs help:
    call the eventstarter action in the beginning (onvideoplay)

    XML: 1
    <action name="eventstarter">
      copy(plugin[video].time);
      if((plugin[video].time GT 5) AND (plugin[video].time LT 6) , blendinspot(hs1)); 
      if((plugin[video].time GT 30) AND (plugin[video].time LT 31) , blendoutspot(hs1)); 
      delayedcall(1.0, eventstarter() );
    </action>

    Since i wanted to keep my hotspots i just tweened the size and alpha and also enabled / disabled them.

    cheers
    Thomas

Participate now!

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