playing videos in succession

Kurt Kaufman kkaufman at snet.net
Fri Dec 5 17:21:48 EST 2003


(I believe this issue came up a few months ago, but I can't seem to 
find the thread.....any pointers appreciated!)

I'm looking for a script that would allow me to play a number of 
separate video clips one after the other.  I understand that it 
involves the player waiting for the playstopped message and then 
starting the next clip.  The only script that I have been able to come 
up with is flawed in two ways:
1) It skips clips 3, 5, 7, etc.  (that must be the missing mathematical 
screw in my brain!);

2) Any of the controls on the player's controller bar cannot receive 
mouseclicks while a clip is playing (so no changing sound volume or 
pausing, etc.). Again, I suspect that has something to do with how I've 
scripted the loop with the player waiting for the playstopped.

Here are the important bits of the script:
(a button sends startMeLoop to player "mp")

--below is the script of player "mp":
--this starts the player on the first video clip listed in the folder 
"goodFiles"

on startMeLoop
   global gCurrentMovie, gMovieTally
   select line 1 of fld "goodFiles"
   put line 1 of fld "goodFiles" into gCurrentMovie
   set the filename of player "mp" to gCurrentMovie
   set the currentTime of player "mp" to 0
   start player "mp"
   put 2 into gMovieTally --for playstopped, below
end startMeLoop



on playstopped
   global gCurrentMovie, gMovieTally
   --if there is only one clip listed in fld "goodFiles", then stop:
   put the number of lines in fld "goodFiles" into NumOfMovies
   if NumOfMovies = 1 then exit playstopped
   set the hilitedline of fld "goodFiles" to empty

if exists (line gMovieTally of fld "goodFiles") then --line 2 or greater
     set the hilitedline of fld "goodFiles" to empty
     select line gMovieTally of fld "goodFiles"
     put line gMovieTally of fld "goodFiles" into gCurrentMovie
     set the filename of player "mp" to gCurrentMovie
     set the currentTime of player "mp" to 0
     start player "mp"
     put (gMovieTally + 1) into gMovieTally --increment by 1, right??
   end if
end playstopped


====end of script======

thanks, Kurt



More information about the Use-livecode mailing list