Multimedia Guide and Reference


Sending MCI commands using a script

If you want to have a block of code run, just write a script. The following script opens the video player, loads a movie and plays it:

runMCI
   | mci |
   mci := (self subpartNamed: 'Media Control Interface').
 
   "Open the digital video device."
   mci send: 'open digitalvideo wait'.
 
   "Load the tahiti movie. It must be in the current directory.
    Or you must specify a full path name in the command."
   mci send: 'load digitalvideo tahiti.avi wait'.
 
   "Play the movie and don't return until the movie is done."
   mci send: 'play digitalvideo wait'.
 
   "Close the digital video device."
   mci send: 'close digitalvideo wait'.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]