Bada is a mobile operating system developed by Samsung. It features flexible configuration, good user interaction, and service-oriented. It attaches great importance to SNS integration and geographic location service applications. Bada is designed to create an era in which everyone can use smartphones. This article describes how to play a real-time rtsp stream on the bada platform.
Use the Osp: Media: Player class
- The supported formats in streaming
-
- Video: H.264, H.263, MPEG4
-
- Audio: AMR-NB, AAC, AAC +, EAAC +
-
- The supported protocol in streaming
-
- RTSP
-
- {
-
-
- _ PPanel = new OverlayPanel ();
-
- _ PPanel-> Construct (Rectangle (0, 58, 480,560 ));
-
- AddControl (* _ pPanel );
-
- _ PPlayer = new Player ();
-
- Osp: Graphics: BufferInfo bufferInfo;
-
- R = _ pPanel-> GetBackgroundBufferInfo (bufferInfo );
-
- _ PListener = new VideoPlayerListener;
-
- R = _ pPlayer-> Construct (* _ pListener, & bufferInfo );
-
- VideoPlayerPlay ();
-
- }
-
-
-
- Void
-
- VideoPlayerForm: VideoPlayerPlay ()
-
- {
-
- Result r = E_SUCCESS;
-
- If (openFlag = false)
-
- {
-
- String resolveString (L "rtsp ://***");
-
- Uri baseUri;
-
- BaseUri. SetUri (resolveString );
-
- R = _ pPlayer-> OpenUrl (baseUri );
-
- R = _ pPlayer-> Play ();
-
- OpenFlag = true;
-
- }
-
- Else
-
- {
-
- AppLog ("file being played ");
-
- }
-
- }
-
- // Because Real-Time Streaming Media is played, it is stopped directly when paused, and a connection is established again when it is restored (VideoPlayerPlay () is called ())
-
- Void
-
- VideoPlayerForm: VideoPlayerPause ()
-
- {
-
- Result r = E_SUCCESS;
-
- PlayerState nowState = _ pPlayer-> GetState ();
-
- If (nowState = PLAYER_STATE_PLAYING)
-
- {
-
- AppLog ("stop ");
-
- R = _ pPlayer-> Stop ();
-
- If (IsFailed (r ))
-
- {
-
- AppLog (">>>>>> (VideoPlayer: VideoPlayerStop) Stop has failed: % s \ n", GetErrorMessage (r ));
-
- Return;
-
- }
-
- R = _ pPlayer-> Close ();
-
- If (IsFailed (r ))
-
- {
-
- AppLog (">>>>>> (VideoPlayer: VideoPlayerStop) Close has failed: % s \ n", GetErrorMessage (r ));
-
- Return;
-
- }
-
- OpenFlag = false;
-
- }
-
- Else
-
- {
-
- AppLog ("file does not play ");
-
- }
-
- }