Page 1 of 1

Newbie question: keyboard control of video

Posted: Thu Dec 16, 2010 5:44 am
by justmark
Hello. I'm an utter newbie and have a question on controlling video events with the keyboard. I'm working with a series of ten videos, each needs to be summoned to play with a unique key press (so key 'a' plays video 1, 'b' plays video 2, and so on) - this is to match a live event where the video is playing in the background and an operator is running the computer to sync (as close as possible) the video to the events on the stage.

I've used other tools in the past that would switch out the video upon receiving a keyboard message, but I don't know if I have to think about Rev in those terms or do I just load up the video I want to play upon a key press? In other words, are there memory or loading constraints I have to worry about to make the videos play smoothly? I think that's where I get slightly confused on the card and stack metaphor. Do I need a new card for each video I play?

Anyway, I'd appreciate any help, even in terms of the right script hints for the key press commands. I am such a stereotypical newbie!

Re: Newbie question: keyboard control of video

Posted: Thu Dec 16, 2010 1:52 pm
by Klaus
Hi Mark,

since you do not want to play these ten videos at the same time, this sound doable.

There is a little delay, when you load a video into a player object, so I would do this:
1. Create ten players on a card
2. Load all ten videos into these players.
3. Hide all players!
4. Add a "keyup" handler to the cardscript the will
a. hide all players and
b. show the desired player and start it or whatever

Code: Select all

on keyup tKey
  ## 
repeat with i = 1 to 10
   stop player i
   hide player i
 end repeat
 switch  tKey
   case "a"
   show player 1
   start player 1
 break
 case "b"
   ## You get the picture
  break
  case "c"
  ##
  break
 end switch
end keyup
This is out of my head, so please test by yourself, if that will work for you.
And ask of course furhter question, if neccessary!

And by the way: Welcome to the club :)


Best from germany

Klaus

Re: Newbie question: keyboard control of video

Posted: Fri Dec 17, 2010 5:20 am
by justmark
Thanks, Klaus. That gives me a great place to start!