Sie sind nicht angemeldet.

1

Dienstag, 2. August 2016, 12:11

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
2
3
4
5
6
<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
2
3
4
5
<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

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

2

Dienstag, 2. August 2016, 15:43

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*

3

Dienstag, 2. August 2016, 19:14

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

4

Dienstag, 2. August 2016, 19:54

HI Tuur,

yeah, i got it to work! Thank you so much, you were a great help for me *smile*

cheers
Thomas

5

Dienstag, 2. August 2016, 20:15

lucky beggar .. is it secret? unlocke it..

6

Dienstag, 2. August 2016, 22:49

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*

7

Mittwoch, 3. August 2016, 11:28

HI Everybody,

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

XML

1
2
3
4
5
6
<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

8

Mittwoch, 3. August 2016, 13:28

Hi Thomas (and Tuur)

Thanks for sharing, I've got a 3 minute video and 24 hotspots to try this out on *smile*

Cheers
Tim

Ähnliche Themen