Next Page > Hide TOC

Legacy Documentclose button

Important: This class is deprecated. Use QTMovie instead.

NSMovie Class Reference (Not Recommended)

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSMovie.h
Related sample code

Important: This class is deprecated. Use QTMovie instead.

Overview

The NSMovie class implements a wrapper for a QuickTime Movie object, providing a simple interface for loading a movie into memory. These wrappers are known as movies.

The movie data can come from a URL or a pasteboard, including the drag-and-drop and cut-and-paste pasteboards. The data can be of any type recognized by QuickTime, including nonvideo data such as pure audio or even still images. Once loaded, you can obtain a pointer to the movie data and use the extensive QuickTime API to manipulate the data.

You can access information about the movie data an NSMovie object encapsulates by using the QTMovie class.

Adopted Protocols

NSCoding
NSCopying

Tasks

Creating Movies

Getting Movie Information

Class Methods

canInitWithPasteboard:

Indicates whether the class can initialize an instance of itself from the data on a given pasteboard.

+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard

Parameters
pasteboard

Pasteboard with which the new NSMovie instance would be initialized.

Return Value

YES when the receiver’s list of supported pasteboard types includes a data type available from pasteboard; NO otherwise.

Availability
See Also
Declared In
NSMovie.h

movieUnfilteredFileTypes

Provides an array of strings representing the file types that contain supported movie data.

+ (NSArray *)movieUnfilteredFileTypes

Return Value

Array of strings identifying the file types that contain supported movie data. This array may be passed directly to the NSOpenPanelrunModalForTypes: method.

Discussion

The default list contains the filename extensions .mov and .MOV, and the HFS file type 'MooV'.

Availability
See Also
Declared In
NSMovie.h

movieUnfilteredPasteboardTypes

Provides an array of pasteboard types from which an NSMovie instance can be created.

+ (NSArray *)movieUnfilteredPasteboardTypes

Return Value

Strings identifying the pasteboard types from which an NSMovie object can be created.

Discussion

Compare the elements of this array to the available data types on a pasteboard to detect the presence of movie data.

Availability
See Also
Declared In
NSMovie.h

Instance Methods

initWithMovie:

Initializes the receiver with a given QuickTime movie that has already been loaded into memory.

- (id)initWithMovie:(void *)movie

Parameters
movie

Movie object with which to initialize the receiver.

Return Value

Initialized NSMovie object, or nil when movie is NULL.

Discussion

When movie is NULL, the receiver is released.

Special Considerations

In programs linked to Mac OS X v10.2 or earlier, the receiver becomes an owner of movie and disposes of it with the DisposeMovie function when the receiver is destroyed.

Availability
Related Sample Code
Declared In
NSMovie.h

initWithPasteboard:

Initializes the receiver with data from a given pasteboard.

- (id)initWithPasteboard:(NSPasteboard *)pasteboard

Parameters
pasteboard

Pasteboard with which to initialize the receiver. It must contain data either of a type returned by movieUnfilteredPasteboardTypes or of type NSFilenamesPboardType. In the latter case, the filename should be for a file of a type returned by movieUnfilteredFileTypes. If the pasteboard contains multiple filenames, only the first name is used.

Return Value

Initialized NSMovie object, or nil when unsuccessful.

Discussion

When archiving an NSMovie object, the movie data is encoded if the data was obtained directly from pasteboard. If instead a filename was on the pasteboard, only the file’s URL is encoded.

If this method is unable to create a movie representation, the receiver is released.

Availability
Declared In
NSMovie.h

initWithURL:byReference:

Initializes the receiver with data located at a given URL.

- (id)initWithURL:(NSURL *)movieUrl byReference:(BOOL)byReference

Parameters
movieUrl

URL identifying the location of movie data. It can use any appropriate URL protocol, including file:, http:, or rtsp:, and reference any type of data recognized by QuickTime, including video, pure audio, or still images.

byReference

YES to encode only the URL when the receiver is archived; NO to have the receiver encode the movie’s QuickTime header information.

Return Value

Initialized NSMovie object, or nil when unsuccessful.

Discussion

For streamed media, use the QuickTime GetMovieLoadState function to determine whether all the movie data has been received yet.

If this method is unable to create a movie representation, the receiver is released.

Availability
Related Sample Code
Declared In
NSMovie.h

QTMovie

Provides an opaque pointer to the receiver’s QuickTime movie data.

- (void *)QTMovie

Return Value

Movie object containing the receiver’s movie data. You can use this value with the QuickTime framework to directly access the movie data.

Availability
See Also
Related Sample Code
Declared In
NSMovie.h

URL

Provides the URL of the file used to initialize the receiver.

- (NSURL *)URL

Return Value

URL of the file containing the movie data used to initialize the receiver, or nil when the receiver wasn’t initialized from a file.

Availability
Declared In
NSMovie.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-03-26)


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.