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:

  1. Create a graphic player for the sequence.
  2. Create a graphic view to display the video.
  3. Connect the player to the graphic view.
    1. Create an output port surrogate for the player.
    2. Create an input port surrogate for the graphic view.
    3. Connect the player to the view.
  4. 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:

  1. Create a graphic player by calling TGraphicPlayer::CreateDefaultGraphicPlayer.
  2. Create a sequence for the QuickTime video, passing the filename to the constructor for TQuickTimeVideoSequence.
  3. Pass the video sequence to the player.
  4. Create a graphic view by calling TGraphicView::CreateDefaultGraphicView.
  5. Set the size of the view by passing the geometric bounds of the sequence to TGraphicView::SetAllocateArea.
  6. Connect the graphic player to the view.
    1. Create an output port surrogate for the graphic player.
    2. Create an input port surrogate for the view.
    3. Call TGraphicOutputPortSurrogate::ConnectTo to connect the graphic player to the view.
  7. Adopt the view into the view hierarchy.
  8. 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