You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, August 2nd 2016, 12:11pm

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

Sage

Posts: 3,170

Location: Netherlands

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

  • Send private message

2

Tuesday, August 2nd 2016, 3:43pm

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*
http://www.virtualtuur.com
Skype:studiotuur

3

Tuesday, August 2nd 2016, 7:14pm

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

Tuesday, August 2nd 2016, 7:54pm

HI Tuur,

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

cheers
Thomas

5

Tuesday, August 2nd 2016, 8:15pm

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

6

Tuesday, August 2nd 2016, 10:49pm

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

Wednesday, August 3rd 2016, 11:28am

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

Wednesday, August 3rd 2016, 1:28pm

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