In the past two days, we finally achieved video playback and encapsulated the underlying API. Combined with the UI, we made a simple video player.
It includes two parts: playing a local file and playing a URL.
The following summarizes the key points involved:
1. Related lib libraries appended to MMP: platformenv, mmfcontrollerframework, bafl, ws32, mediaclientvideo.
2. Use the cvideoplayerutility and mvideoplayerutilityobserver classes in the SDK.
Open the local file and use the cvideoplayerutility: openfilel () interface to pass only one parameter-file path, corresponding to the Symbian OS file system.
Open the URL and use the cvideoplayerutility: openurll () interface. The first parameter is URL and the second parameter must be specified. The following is a detailed description.
3. It is easy to play local files, and problems occur when using openurll. After openurll is called, The status is successful in the mvpuoopencomplete callback function. However, calling prepare fails. The error code is-39.
Cause: Because you need to access the network when playing a URL, you must specify the iapid (the ID of the Internet access point to use) when using the openurll interface. The simulator uses the Ethernet network, the corresponding iapid is 3. You can also use the default iap id. Therefore, the call method is ivideoplayer-> openurll (afileurl, kusedefaultiap, knulldesc8, knulluid );
4. Playing streaming media only supports the RTSP Protocol. To test the RTSP protocol, I used helixserver to build a Streaming Media Server.
Summarize several errors encountered during implementation:
(1) openfilelMvpuoopencomplete return
Kerrnotsupported.
Possible cause: the file path is incorrect; the corresponding lib library is missing.
(2) mvpuopreparecomplete return-39
Openfilel is used. If open is successful, this problem will not occur. Openurll is more prone to this problem.
In addition, I specified the file format during the test. Some people say that if the file path or URL does not specify the file format, you need to set media-related parameters before opening the file.