This tutorial describes how to control video playback.
The purpose of this tutorial is to show you how to use the video player to control video playback.
Required Background
The Video Client Overview introduces the video client utilities.
Introduction
The video player utility is used to open, play, and obtain information from sampled video data. This functionality is implemented by the CVideoPlayerUtility
class. The video data can be supplied either in a file, a descriptor or a URL.
The sequence diagram below explains the different functionalities of the Video Player Utility:
Figure: Video Player sequence diagram
The following tasks will be covered in this tutorial:
The high level steps to play video clips are shown here:
After configuring the properties, the CVideoPlayerUtility::Play()
function is called for the video clip to be played.
The play can be paused for a small duration using CVideoPlayerUtility::PauseL()
and later resumed by calling CVideoPlayerUtility::Play()
function once again.
To halt the video play CVideoPlayerUtility::Stop()
is called.
In order to unload all related controllers and return, use CVideoPlayerUtility::Close()
.
These high level steps are shown in the following example code:
void CPlayVideo::Play() //Starts playback of the video clip { iVideoUtility->Play(); } void CPlayVideo::PauseL() //Call to this function will maintain the current position //playback can be resumed by calling Play function again { TRAPD(err,iVideoUtility->PauseL()); } TInt CPlayVideo::Stop() //Stops playing { TInt err = iVideoUtility->Stop(); return err; }
Note: You must call the CVideoPlayerUtility::Prepare()
function, before calling any of the functions used in the above given code.
The high level steps to get the current frame are shown here:
To get the video frame currently being played, use the CVideoPlayerUtility::GetFrameL()
function.
void CPlayVideo::GetFrameL(TDisplayMode aDisplayMode) //Returns the current frame { iVideoUtility->GetFrameL(aDisplayMode); }
The current frame is sent to the client asynchronously via the MVideoPlayerUtilityObserver::MvpuoFrameReady()
callback function.