Playing video data
There are two ways to play video data: use a TMovie object or create your own video components. To use TMovie, see "Getting started with video" on page 284.
To play a video sequence:
- Create a graphic player for the sequence.
- Create a graphic view to display the video.
- Connect the player to the graphic view.
- Create an output port surrogate for the player.
- Create an input port surrogate for the graphic view.
- Connect the player to the view.
- Call the Play function on the player.
You can use WaitUntilComplete to block the thread until the video is finished playing; the Play function returns immediately.
For example, to play a QuickTime video:
- Create a graphic player by calling TGraphicPlayer::CreateDefaultGraphicPlayer.
- Create a sequence for the QuickTime video, passing the filename to the constructor for TQuickTimeVideoSequence.
- Pass the video sequence to the player.
- Create a graphic view by calling TGraphicView::CreateDefaultGraphicView.
- Set the size of the view by passing the geometric bounds of the sequence to TGraphicView::SetAllocateArea.
- Connect the graphic player to the view.
- Create an output port surrogate for the graphic player.
- Create an input port surrogate for the view.
- Call TGraphicOutputPortSurrogate::ConnectTo to connect the graphic player to the view.
- Adopt the view into the view hierarchy.
- Call Play on the player.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.
Generated with WebMaker