Saturday, March 20, 2010

Show player code for revMedia

Pretty straightforward. I was in a rush so it's inefficient and unoptimized. Plus I hardcoded the file names.

--MAKE SCREEN BLACK, INITIALIZE VARIABLES

on openstack

global videopos

put "1200,400" into videopos

hide menubar

set the width of this stack to 2000

set the height of this stack to 900

set the location of this stack to 300,400

set the lockerrordialogs to true

end openstack


--PRESS ESC TO EDIT

on escapekey

show menubar

end escapekey


--PRESS TAB TO INITIALIZE

on tabkey

openstack

end tabkey


--PAUSE VIDEO

on returnkey

global thevideo

if there is a videoclip thevideo then

if the paused of videoclip thevideo is true then

set the paused of videoclip thevideo to false

else

set the paused of videoclip thevideo to true

end if

end if

end returnkey



--MAIN SHOW CONTROL

on keydown thekey

global thevideo, videopos

--JASMINE CUES LEFT

if thekey is "1" then

checkvideo

put "/Users/faculty/Desktop/show/1-flowerL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "2" then

checkvideo

put "/Users/faculty/Desktop/show/2-juniperL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "3" then

checkvideo

put "/Users/faculty/Desktop/show/3-UNL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "4" then

checkvideo

put "/Users/faculty/Desktop/show/4-fallingL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "a" then

checkvideo

put "/Users/faculty/Desktop/show/a-airportLEFT.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "b" then

checkvideo

put "/Users/faculty/Desktop/show/b-channelchangeL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "c" then

checkvideo

put "/Users/faculty/Desktop/show/c-rewindL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "d" then

checkvideo

put "/Users/faculty/Desktop/show/d-fastforwardL.mov" into thevideo

play videoclip thevideo at videopos

else if thekey is "e" then

checkvideo

put "/Users/faculty/Desktop/show/e-skyL.mov" into thevideo

play videoclip thevideo at videopos

--FADE

else if thekey is "0" then

lock screen

if there is a videoclip thevideo then stop playing videoclip thevideo

unlock screen with visual dissolve

end if

end keydown



--CLEAR ANY EXISTING VIDEO IF PLAYING

on checkvideo

global thevideo

if movie() ≠ "done" then

lock screen

stop playing videoclip thevideo

unlock screen with visual dissolve

end if

end checkvideo

No comments: