I know three ways to play the real audio file, but unfortunately there is only one way using which I can play the file.
Method 1: (Working)
Method 2: (Not Working)Code:HBufC* param = HBufC::NewLC( 250 ); param->Des().Format( _L( "4 %S" ),&aUrl ); // Wap Browser's constants UId const TInt KWmlBrowserUid = 0x10008D39; TUid id( TUid::Uid( KWmlBrowserUid ) ); TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); TApaTask task = taskList.FindApp( id ); if ( task.Exists() ) { HBufC8* param8 = HBufC8::NewLC( param->Length() ); param8->Des().Append( *param ); task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used CleanupStack::PopAndDestroy(); // param8 } else { RApaLsSession appArcSession; User::LeaveIfError(appArcSession.Connect()); // connect to AppArc server TThreadId id; appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid ), id ); appArcSession.Close(); } CleanupStack::PopAndDestroy(); // param
Method 3: (Not Working)Code:HBufC* param = HBufC::NewLC( 250 ); param->Des().Format( _L( "4 %S" ),&aUrl ); // Real Player's constants UId const TInt KWmlBrowserUid = 0x10005A3E; TUid id( TUid::Uid( KWmlBrowserUid ) ); TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); TApaTask task = taskList.FindApp( id ); if ( task.Exists() ) { HBufC8* param8 = HBufC8::NewLC( param->Length() ); param8->Des().Append( *param ); task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used CleanupStack::PopAndDestroy(); // param8 } else { RApaLsSession appArcSession; User::LeaveIfError(appArcSession.Connect()); // connect to AppArc server TThreadId id; appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid ), id ); appArcSession.Close(); } CleanupStack::PopAndDestroy(); // param
Code:HBufC* param = HBufC::NewLC( 250 ); param->Des().Format( _L( "4 %S" ),&aUrl ); CDocumentHandler *iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() ); CleanupStack::PushL(iDocHandler); TDataType data = TDataType(KNullUid); iDocHandler->OpenFileEmbeddedL(aUrl, data); CleanupStack::PopAndDestroy();
In all the above code examples, aUrl is the URL for the real audio file.
Method 1 is working fine but the problem is that it first open the browser and then a blank page and then the real player. Now when user want to exit the Real Player, they have to first close the real player then the blank page and finally the browser window.
Is there any method using which I can directly play the file from Real Player?

Reply With Quote


