Graphics Reference
In-Depth Information
The
QTMovie
object from QTKit provides all you need for movie control, such as playback,
scrubbing, fast forward, and so on. The difference is that
QTMovie
doesn't have the visual
elements that
QTMovieView
does. Instead, you must tie your actions to outlets such as
sliders and buttons. The action methods available to you in
QTMovie
are listed in Table 7-1.
Table 7-1
QTMovie's Action Methods
Method
Description
autoplay
does the same thing as play except it is for
use with streaming media. It will only start playing
back the movie when enough data is available.
- autoplay
Begins movie playback.
- play
Stops movie playback.
- stop
Sets the
currentTime
field in the
QTMovie
object to
QTMovieZero
, the movie beginning.
- gotoBeginning
Sets the
currentTime
field in the
QTMovie
object to
match the movie duration.
- gotoEnd
If a selection point has been set in the
QTMovie
object, sets the
currentTime
field to that selection
point.
- gotoNextSelectionPoint
If a selection point has been set in the
QTMovie
object, sets the
currentTime
field to that selection
point if that time is prior to the
currentTime
field's
time.
- gotoPreviousSelectionPoint
Sets the
currentTime
field in the
QTMovie
object to
the poster frame time. If no poster frame is specified,
currentTime
is set to the beginning of the movie.
- gotoPosterFrame
Sets the
currentTime
field in the
QTMovie
object to
the
QTTime
you specify as a parameter.
- setCurrentTime:
Advances the movie ahead by one frame. The
currentTime
field is updated accordingly.
- stepForward
Steps the movie back by one frame. The
currentTime
field is updated accordingly.
- stepBackward
You can simply create an
IBAction
method in your controller and call any of these
methods from those actions. See the upcoming section, “Adding Basic Playback
Controls,” to see how this is done.
Creating a Simple QTMovieLayer-Based Player
In the sample project for this chapter called Movie Player with Overlay (on the compan-
ion website), we created an application delegate class, called
AppDelegate
, that we associ-
ated with a controller object in Interface Builder. With this set up, the
AppDelegate
class
gives us an entry point to create and display the
QTMovieLayer
. In this project, in addi-
tion to the QuartzCore framework, we added the QTKit framework. It is located at