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

Thursday, April 19th 2012, 1:09am

Videoplayer pause with spacebar

I have been trying to get the sparebar to toggle pause/play, and have not been successful. see the code below.

Maybe this is not even possible but i doubt it ;)

i think my error is in line 8- set(plugin[video].togglepause());
i have tried other iteration with no luck.
can plugin[video].togglepause() only be run as a onclick command?

thanks for the help!



<events onkeydown="checkkey();" />

<action name="checkkey">
trace('keycode=', keycode);
if(keycode == 32, action(pausebar);
</action>
<action name="pausebar">
set(plugin[video].togglepause());
</action>

2

Thursday, April 19th 2012, 3:23pm

Hi,

there is just a missing ')' here to close the if():

if(keycode == 32, action(pausebar) );

best regards,
Klaus

3

Saturday, April 21st 2012, 12:33am

i get no pause or effect when pressing the space bar with this code..


<events onkeydown="checkkey();" />

<action name="checkkey">
trace('keycode=', keycode);
if(keycode == 32, action(pausebar));
</action>

<action name="pausebar">
set(plugin[video].togglepause());
</action>

any other ideas anyone?


Thanks for your help Klaus!

4

Saturday, April 21st 2012, 2:44am

I got it to work when I changed

set(plugin[video].togglepause());

by removing the " set( " and last " ) " to leave just

plugin[video].togglepause();

Jeff *confused*

5

Saturday, April 21st 2012, 2:58am

That did it! Thanks Jeff!