Next Page > Hide TOC

Legacy Documentclose button

Important: This class is deprecated. Use QTMovieView instead.

NSMovieView Class Reference (Not Recommended)

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Companion guide
Declared in
NSMovieView.h
Related sample code

Important: This class is deprecated. Use QTMovieView instead.

Overview

An NSMovieView displays an NSMovie (a wrapper for a QuickTime movie) in a frame and provides methods for playing and editing the movie. The view can optionally display a standard QuickTime movie controller, or you can provide your own interface linked to NSMovieView’s action methods.

Tasks

Managing Movie Views

Configuring Playback

Playing Movies

Managing Sound

Using Movie Controllers

Editing

Instance Methods

copy:

This action method copies the current movie selection onto the clipboard.

- (void)copy:(id)sender

Discussion

If there is no selection, the current frame is copied. The movie does not need to be editable.

Availability
See Also
Declared In
NSMovieView.h

cut:

This action method deletes the current movie selection from the movie, placing it on the clipboard.

- (void)cut:(id)sender

Discussion

If there is no selection, the current frame is deleted. This action is undoable. If the movie is not editable, this method does nothing.

Availability
See Also
Declared In
NSMovieView.h

delete:

This action method deletes the current movie selection from the movie, placing it on the clipboard.

- (void)delete:(id)sender

Discussion

If there is no selection, the current frame is deleted. This action is undoable. If the movie is not editable, this method does nothing.

Availability
Declared In
NSMovieView.h

gotoBeginning:

This action method repositions the play position to the beginning of the movie.

- (void)gotoBeginning:(id)sender

Discussion

If the movie is playing, the movie continues playing from the new position.

Availability
See Also
Declared In
NSMovieView.h

gotoEnd:

This action method repositions the play position to the end of the movie.

- (void)gotoEnd:(id)sender

Discussion

If the movie is playing in one of the looping modes, the movie continues playing accordingly; otherwise, play stops.

Availability
See Also
Declared In
NSMovieView.h

gotoPosterFrame:

This action method repositions the play position to the movie’s poster frame.

- (void)gotoPosterFrame:(id)sender

Discussion

If no poster frame is defined, the movie jumps to the beginning. If the movie is playing, the movie continues playing from the new position.

Availability
See Also
Declared In
NSMovieView.h

isControllerVisible

Returns YES if the movie controller is visible.

- (BOOL)isControllerVisible

Discussion

The default is YES.

Availability
See Also
Declared In
NSMovieView.h

isEditable

Returns YES if the movie is editable.

- (BOOL)isEditable

Discussion

When editable, a movie can be modified using the clear:, cut:, and paste: methods and associated key commands. You can also drag movie files into the view, replacing the movie. The default is YES.

Availability
See Also
Declared In
NSMovieView.h

isMuted

Returns YES if the movie’s sound is currently muted.

- (BOOL)isMuted

Availability
See Also
Declared In
NSMovieView.h

isPlaying

Returns YES if the movie is currently playing.

- (BOOL)isPlaying

Availability
See Also
Related Sample Code
Declared In
NSMovieView.h

loopMode

Returns the playback behavior for when the end of the movie is reached.

- (NSQTMovieLoopMode)loopMode

Discussion

Return value is one of the constants defined in “Constants.” Default is NSQTMovieNormalPlayback.

Availability
See Also
Declared In
NSMovieView.h

movie

Returns the NSMovie object displayed in the view.

- (NSMovie *)movie

Availability
See Also
Declared In
NSMovieView.h

movieController

Returns a pointer to a QuickTime MovieController for the Movie displayed in the view.

- (void *)movieController

Discussion

Use this method with the QuickTime APIs to enable features not implemented in NSMovieView. A movie controller is available whenever a movie is displayed in a window, even if the controller is itself hidden. If no movie is displayed, movieController returns NULL.

Availability
See Also
Declared In
NSMovieView.h

movieRect

Returns the rectangle into which the movie is to be placed.

- (NSRect)movieRect

Discussion

By default, this method returns the view’s bounding rectangle. Override this method if you want the movie to be positioned or sized differently within the view.

Availability
Declared In
NSMovieView.h

paste:

This action method inserts the contents of the clipboard (if it contains a movie clip) into the movie at the current play position.

- (void)paste:(id)sender

Discussion

This action is undoable. If the movie is not editable, this method does nothing.

Availability
See Also
Declared In
NSMovieView.h

playsEveryFrame

Returns YES if the movie is configured to display every frame when playing.

- (BOOL)playsEveryFrame

Discussion

Default is NO.

Availability
See Also
Declared In
NSMovieView.h

playsSelectionOnly

Returns YES if the movie is configured to play only the selected portion.

- (BOOL)playsSelectionOnly

Discussion

Default is NO.

Availability
See Also
Declared In
NSMovieView.h

rate

Returns the relative frame rate at which the movie is to be played.

- (float)rate

Discussion

The default value of 1.0 indicates the normal frame rate defined by the movie.

Availability
See Also
Related Sample Code
Declared In
NSMovieView.h

resizeWithMagnification:

Resizes the view’s frame to the size required to display the movie with a magnification of magnification and with a movie controller below it.

- (void)resizeWithMagnification:(float)magnification

Availability
See Also
Declared In
NSMovieView.h

selectAll:

This action method selects the entire movie.

- (void)selectAll:(id)sender

Availability
Declared In
NSMovieView.h

setEditable:

Sets whether the movie can be edited.

- (void)setEditable:(BOOL)flag

Discussion

If flag is YES, you can use the clear:, cut:, and paste: methods and associated key commands to modify the movie. You can also drag a new movie file into the view, replacing the current movie. If flag is NO, these features are disabled.

Availability
See Also
Declared In
NSMovieView.h

setLoopMode:

Sets the playback behavior for when the end of the movie is reached.

- (void)setLoopMode:(NSQTMovieLoopMode)flag

Discussion

flag is one of the constants defined in “Constants.” If flag is NSQTMovieNormalPlayback, the movie stops playing when it reaches the end. If flag is NSQTMovieLoopingPlayback, the movie will continue playing at the beginning. If flag is NSQTMovieLoopingBackAndForthPlayback, the movie will play in reverse, then forward again, as it reaches each end of the movie. If playsSelectionOnly is YES, these behaviors apply to the endpoints of the selection, not the movie.

Availability
See Also
Declared In
NSMovieView.h

setMovie:

Sets the NSMovie displayed in the view to movie.

- (void)setMovie:(NSMovie *)movie

Availability
See Also
Declared In
NSMovieView.h

setMuted:

Sets whether the movie’s sound is muted.

- (void)setMuted:(BOOL)flag

Discussion

When flag is YES, muting is turned on. When muting is turned off again by sending NO for flag, the previous sound volume is restored.

Availability
See Also
Declared In
NSMovieView.h

setPlaysEveryFrame:

Sets whether the movie plays every frame of the movie.

- (void)setPlaysEveryFrame:(BOOL)flag

Discussion

If flag is YES, every frame of the movie is displayed, even if this requires playing the movie slower than its preferred rate. If flag is NO, the movie may skip some frames if needed to maintain its time sequence.

If flag is YES, audio is not played.

Availability
See Also
Declared In
NSMovieView.h

setPlaysSelectionOnly:

Sets whether only the selected portion of the movie is played to flag.

- (void)setPlaysSelectionOnly:(BOOL)flag

Discussion

If there is no selection, the entire movie is played.

Availability
See Also
Declared In
NSMovieView.h

setRate:

Sets the frame rate, relative to the movie’s internal frame rate, at which to play the movie.

- (void)setRate:(float)rate

Discussion

The default rate of 1.0 indicates the movie is played at its normal rate. Larger values indicate faster rates, and fractional values indicate slower rates. Negative values are allowed, causing the movie to play in reverse. Invoking this method does not automatically start the movie playing.

This value is ignored if the movie is started using the movie controller, which always plays the movie at the normal rate.

Availability
See Also
Declared In
NSMovieView.h

setVolume:

Sets the relative sound volume of the movie.

- (void)setVolume:(float)volume

Discussion

The default volume of 1.0 indicates the current system volume.

Availability
See Also
Declared In
NSMovieView.h

showController:adjustingSize:

Sets whether a standard QuickTime movie controller is displayed beneath the movie to show.

- (void)showController:(BOOL)show adjustingSize:(BOOL)adjustSize

Discussion

If adjustSize is YES, the view’s height is modified so that the size and position of the movie are unchanged. If adjustSize is NO, the view’s size is unchanged, and the movie is resized to fit into the frame. The adjustment is made only if the visibility of the controller is indeed changed.

Availability
See Also
Declared In
NSMovieView.h

sizeForMagnification:

Returns the required size of the movie view if the movie were magnified to magnification.

- (NSSize)sizeForMagnification:(float)magnification

Discussion

An extra 16 pixels are added to the vertical dimension to allow room for the movie controller, even if it is currently hidden.

Availability
See Also
Declared In
NSMovieView.h

start:

This action method starts the movie playing at its current location.

- (void)start:(id)sender

Discussion

This method does nothing if the movie is already playing.

Availability
See Also
Declared In
NSMovieView.h

stepBack:

This action method repositions the movie’s play position to one frame before the current frame.

- (void)stepBack:(id)sender

Discussion

If the movie is playing, the movie will stop at the new frame.

Availability
See Also
Declared In
NSMovieView.h

stepForward:

This action method repositions the movie’s play position to one frame after the current frame.

- (void)stepForward:(id)sender

Discussion

If the movie is playing, the movie will stop at the new frame.

Availability
See Also
Declared In
NSMovieView.h

stop:

This action method stops the movie.

- (void)stop:(id)sender

Availability
See Also
Declared In
NSMovieView.h

volume

Returns the relative volume at which the movie is to be played. Default is 1.0.

- (float)volume

Availability
See Also
Declared In
NSMovieView.h

Constants

NSQTMovieLoopMode

These constants specify playback modes.

typedef enum {
   NSQTMovieNormalPlayback,
   NSQTMovieLoopingPlayback,
   NSQTMovieLoopingBackAndForthPlayback
} NSQTMovieLoopMode;

Constants
NSQTMovieNormalPlayback

Playback stops when end is reached.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in NSMovieView.h.

NSQTMovieLoopingPlayback

Restarts playback at beginning when end is reached.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in NSMovieView.h.

NSQTMovieLoopingBackAndForthPlayback

Playback runs forward and backward between both endpoints.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in NSMovieView.h.

Availability
Declared In
NSMovieView.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-02)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.