imovie
Play video
Description
Plays a movie in a user-interface object within the patcher window.
Arguments
None.
Attributes
autofit[int]: 0
Sets the movie to fit automatically within the size of the imovie window.
border[int]: 1
Toggles the drawing of border around the imovie object. The default is 1 (draw border).
moviedim[2 ints]
read-only
Displays the original dimensions of the movie in pixels.
name[symbol]
Specifies the name of the file that the imovie object will display. The symbol used as a filename must either be the name of a file in Max's current search path, or an absolute pathname for the file (e.g. ). The file name can be specified using the object's Inspector. The word by itself puts up a standard Open Document dialog box.
Common Box Attributes
annotation[symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background[int]: 0
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color[4 floats]
Sets the color for the object box outline.
fontface[int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname[symbol]
Sets the object's font.
fontsize[float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hint[symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick[int]: 0
Toggles whether an object ignores mouse clicks in a locked patcher.
jspainterfile[symbol]
You can override the default appearance of a user interface object by assigning a JavaScript file with code for painting the object. The file must be in the search path.
patching_rect[4 floats]: 0. 0. 100. 0.
Sets the position and size of the object in the patcher window.
position[2 floats]
write-only
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation[int]: 0
Sets whether an object belongs to the patcher's presentation.
presentation_rect[4 floats]: 0. 0. 0. 0.
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect[4 floats]
write-only
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size[2 floats]
write-only
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor[4 floats]
Sets the color for the object's text in RGBA format.
textjustification[int]
Sets the justification for the object's text.
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname[symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
bang
Same as
.
int
Sets the current time location of the movie. If the movie is playing, it will play from the newly set location. 0 is always the beginning. The end time varies from one movie to another. (The
message reports the end time location out the left outlet.)- location
[int]
(drag)
When a QuickTIme movie file is dragged from the Max File Browser to a imovie object, the file will be loaded.
active
The word
, followed by a non-zero number, makes the movie active (the default). Followed by a 0, makes the movie inactive. An inactive movie will not play or change location.- flag
[int]
clear
Has the same effect as
with no arguments.
dispose
Removes all movies from the imovie object's memory. If the word is followed by the name of a loaded movie, only the named movie will be removed.
- filename
[symbol]
duration
Reports the duration of the movie (in milliseconds) from the left outlet.
getduration
Reports the end time position of the movie (in Time Units) from the left outlet.
getrate
Reports the current rate multiplied by 65536 out the right outlet. Thus, normal speed is reported as
, half speed is reported as , double speed backward is reported as , etc. If the movie is not playing, the rate is reported as , and if no movie has yet been loaded nothing is sent out.
gettime
Reports the current time location of the movie.
length
The
message's functionality is equivalent to the message.
loadintoram
The word
, followed by a non-zero number, attempts to load the entire movie into memory, if possible. The default is 0.- flag (0 or non-zero)
[int]
loop
The word
0: looping off (default) 1: looping on 2: palindrome mode (forward and then backward)
- flag
[int]
loopend
Sets the ending point of a loop. The default value the time value that represents the end of the movie.
- endpoint
[int]
looppoints
The word
, followed by two numbers, sets the beginning and end points of a loop. the default values are 0 (i.e., the start of the film) for the start point and the end of the film for the endpoint.- start
[int]
- end
[int]
loopset
See the
entry.- start
[int]
- end
[int]
loopstart
Sets the beginning point of a loop. The default value is 0 (the start of the movie).
- startpoint
[int]
matrix
The word
The transform matrix operation consists of nine matrix elements
- transform
[list]
(mouse)
Double-clicking on the imovie object will make the movie window active.
mute
The word
, followed by a non-zero number, turns off the movie's sound (if it has any). Followed by a 0, turns on the movie's sound (the default).- flag
[int]
next
The word
, followed by a number, moves the time location ahead by that amount. If no number is supplied, moves the time ahead by 5. (The actual time meaning of these units varies from movie to movie.)- time-units
[int]
nextmovie
Stops the movie if it is playing, and switches to the movie that was loaded just prior to the current movie. (The movies are stored in reverse order from the order in which they were loaded.) If there is no prior movie,
wraps around back to the most recently loaded movie. Note that the title of the movie window is not automatically changed, even though the "current movie" has been changed by .
palindrome
The word
, followed by a non-zero number, sets the movie to play in palindrome mode (forward and then backward). Looping must be turned on. (the default) disables palindrome mode.- flag
[int]
passive
The word
, followed by a non-zero number, sets the passive mode. In passive mode, starting a movie will not cause the frame to change unless a bang message is received. (the default) sets the movie object to respond to normal messages.- flag
[int]
pause
Pause movie playback
prev
The word
, followed by a number, moves the time location backward by that amount. If no number is supplied, moves the time backward by 5.- time-units
[int]
quality
The word
, followed by a number, sets the minimum interval, in milliseconds, between movie redraws. The default is 0 (i.e., no minimum).- interval
[int]
rate
The word
, followed by one or more integers or floats, sets the playing speed of the movie. If is followed by one integer, that number is taken to be a whole number playing speed. If is followed by two numbers, the first number is taken to be the numerator and the second the denominator of a fractional speed. is the normal playing speed, means the movie is stopped, and a negative rate plays backwards. would play the movie at half speed. Immediately after you send a non-zero message, the movie will begin playing, so you may wish to precede any messages with an integer to locate to the desired starting position.- speed
[list]
rd
Same as
.- filename
[symbol]
read
The word
, followed by a symbol, looks for a movie file with that name in Max's file search path, and opens it if it exists, displaying the movie's first frame in a movie window. If the filename contains any spaces or special characters, the name should be enclosed in double quotes or each special character should be preceded by a backslash ( ). The word by itself puts up a standard Open Document dialog box and reads in any movie file you select. The message will open at least 26 different types of files that can be opened. These include movie files such as MPEG, audio files including AIFF and MP3, and graphics files including GIF and JPEG.- filename
[symbol]
readany
The
message opens any type of file to try to interpret it as a movie or other supported media file.- filename
[symbol]
rect
The word
, followed by four numbers, specifies the size of the rectangle in which the movie is displayed within the movie window. The first two numbers specify the position of the rectangle within the movie window, in relative coordinates, and the second two numbers specify the width and height, in pixels, of the rectangle.- x
[int]
- y
[int]
- width
[int]
- height
[int]
reload
The word
will reload the current movie into memory (can be used to refresh; for example, if a movie is playing and the message is sent followed by , the movie will reload into memory and be set to play from the beginning as a newly loaded movie).
resume
Begins playing the movie from its current location, at the most recently specified rate.
start
Sets the movie's rate to 1 and begins playing from the beginning. If the word
is followed by the name of a specific loaded movie, that movie becomes the current movie before starting.- filename
[symbol]
startat
The word
, followed by a number, set the current time location of the movie and begins playing from that point.- location
[list]
stop
Stops the movie.
switch
The word
, followed by a symbol, makes the named movie the active one without changing the transport state (See the message).- filename
[symbol]
time
The word
, followed by a number that specifies a frame number, goes to the time location specified by the number. When no argument is present, the message's functionality is equivalent to the message.- frame
[int]
timescale
Reports the timescale of the movie (the number of Time Units per second) from the left outlet.
vol
The word
, followed by a number in the range 1-255, sets the movie's sound volume. Optionally, the volume can be set by using the word , followed by a floating-point value in the range 0. - 1.0.- volume
[number]
Output
int
Out left outlet: The end time of the movie is sent out in response to the
Out middle outlet: The horizontal position of the mouse, relative to the left edge of the movie, is sent out when the mouse is clicked or dragged inside the movie.
Out right outlet: The vertical position of the mouse, relative to the top edge of the movie, is sent out when the mouse is clicked or dragged inside the movie.
See Also
Name | Description |
---|---|
lcd | Display graphics (deprecated) |
movie | Play a movie in a window |
playbar | Control video or audio file playback |