Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
Video Recording and Video Playing APIs
Using CVideoRecorderUtility and CVideoPlayerUtility we can record the video and play the video file. Following are steps to record and playing video files:
CVideoRecorderUtility provides the features to record video clips to files, descriptor or URL's and manipulate embedded meta data. Following steps are to record the video file
In the first step, we need to specify the handler to the camera, the controller UID and the video formats and codecs used for video. Following are different functions to open the video file:
- CVideoRecorderUtility::OpenFileL(): This function is used to record video clips to files.
- CVideoRecorderUtility::OpenDesL(): This function is used to record video clips into descriptor.
- CVideoRecorderUtility::OpenUrlL(): This function is used to record video clips into URLs
After opening the video, we need to configure it. In this configuration part, we need to set the priority,MIME types and codecs, Bits and frame rates and finally set gain settings using GainL() or SetGainL() or MaxGainL().
While creating the Video recording applications we need to use the observer class MVideoRecorderUtilityObserver. It has following callback functions:
- MvruoOpenComplete: Once after calling OpenFileL() or OpenDesL() or OpenUrlL() function, if the opening video complete then this callback function will be called.
- MvruoPrepareComplete: After Opening of the video completes, we need to call Prepare() function. Once preparing video completes then this callback will be called
- MvruoRecordComplete: After the Preparing video completes, we need to call Record() function. Once recording completes this callback will be called.
- MvruoEvent: This is the general event notification from the controller.
CVideoPlayerUtility provides the features to play video files or play video from descriptors or play video from URL. Following steps are used to play video:
CVideoPlayerUtility provides following methods to open the video
- CVideoPlayerUtility::OpenFileL(): This method is used to play video from file.
- CVideoPlayerUtility::OpenDesL(): This method is used to play video from descriptor
- CVideoPlayerUtility::OpenUrlL(): This method is used to play video from URL.
While configuring the video, we need to set the priority, MIME type and codecs, Bit and framerates, Volume settings like Volume() or SetVolumeL() or MaxVolume(), and audio playback balance settings using SetBalanceL().
While creating video playing applications, we need to use the observer class MVideoPlayerUtilityObserver. And observer class has following callback functions:
- MvpuoOpenComplete: After opening the video file completes, this callback function will be called.
- MvpuoPrepareComplete: After opeing the video file comples, we need to call Prepare() function, if the prepare completes then this callback will be called.
- MvpuoPlayComplete: After preparing the video file completes, then we need to call Play() function, after playing completes this callback will be called.
- MvpuoEvent: This is the general event notification from controller.
- MvpuoFrameReady: This callback function will be called when the frame for which the request was made will be ready to use.
We can also Pause the video playing using CVideoPlayerUtility::Pause() and Stop the video playing using CVideoPlayerUtility::Stop()