×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    9

    Opening RealPlayer on a video from a program

    Hi everybody,

    I have tried unsuccessfully to use the CVideoPlayer class and the internal framework to play videos on S60 devices from inside a program, and I am now trying to simply play the video files with the internal RealPlayer software.

    I am able to call the RealPlayer from inside my program with the view system by calling the RealPlayer's UID like this:
    Code:
    	TVwsViewId videoid(TUid::Uid(0x10005a3e), TUid::Uid(0x01)); // (same result with 0x02 here)
    	ActivateViewL(videoid);
    But it is not possible to open a specific video from this code, which is what I am looking for. I have then tried to give to the realplayer application a message, like it is done when opening the internal web browser to a specific page, but I am not sure that it is possible (and I am sure than my code is not working...)
    Code:
    	RApaLsSession apaLsSession;
    	const TUid RealPlayerUid = {0x10005A3E}; // 0x1020724D on 3rd Edition!
    	HBufC* param = HBufC::NewLC(64);
    	param->Des().Copy(_L("1 C:\\private\\10005A3E\\matrix-ping-pong.3gp"));
    	TUid id(RealPlayerUid);
    	TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    	TApaTask task = taskList.FindApp(id);
    	if(task.Exists())
    	{
    		task.BringToForeground();
    		HBufC8* param8 = HBufC8::NewLC(param->Length());
    		param8->Des().Append(*param);
    		task.SendMessage(TUid::Uid(0), *param8); // UID not used
    		CleanupStack::PopAndDestroy(param8);
    	}
    	else
    	{
    		if(!apaLsSession.Handle())
    		{
    			User::LeaveIfError(apaLsSession.Connect());
    		}
    		TThreadId thread;
    		User::LeaveIfError(apaLsSession.StartDocument(*param, RealPlayerUid, thread));
    		apaLsSession.Close();
    	}
    	CleanupStack::PopAndDestroy(param);
    In this case the RealPlayer is opening like usual to the main page. I have tried to change the video address with various possibilities (like the name only without the path, "matrix-ping-pong.3gp") and I am sure that my test application's UID is 10005A3E.

    So is there a simple reason for this not to work (like "sorry, but realplayer cannot open directly a specific video anyway...") or can somebody give me an advice or a link dealing with this problem please?

    Thank you by advance for your reply!

  2. #2
    Super Contributor
    Join Date
    Oct 2005
    Posts
    739

    Re: Opening RealPlayer on a video from a program

    HI

    Try this link . Hope this will provide you necessary information you want.

    http://www.antonypranata.com/article...plication.html

    Regards,
    Peter

  3. #3
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Opening RealPlayer on a video from a program

    you can see the API Implementation from this example from the link of nokia
    http://forum.nokia.com/info/sw.nokia..._0_en.zip.html

  4. #4
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: Opening RealPlayer on a video from a program

    hi pwiit...

    Try to this code hope It'll help you....

    CDocumentHandler *iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );

    CleanupStack::PushL(iDocHandler);

    TDataType data = TDataType(KNullUid);
    TBuf<256>param;
    param.Copy(_L("c:\\Nokia\\Videos\\sample.3gp"));

    iDocHandler->OpenFileEmbeddedL(param,data);

    CleanupStack::PopAndDestroy();

    add this header file .....
    #include <documenthandler.h>
    and lib....commonui.lib

  5. #5
    Registered User
    Join Date
    Mar 2007
    Posts
    9

    Re: Opening RealPlayer on a video from a program

    Thank you everybody for your replies, that helps me a lot!

    Quote Originally Posted by kkrish
    you can see the API Implementation from this example from the link of nokia
    http://forum.nokia.com/info/sw.nokia..._0_en.zip.html
    Hi kkrish,

    I have already looked at this example but could not make it work, that seems quite too complicated for me, and I only want to play a video file so the real Player app is enough for me (if I can make it work, of course).

    The main problem with this example is that it is not a simple video player example but is also speaking about camera, recording and all that stuff; and it is quite complicated for me to find in the few code lines I am looking for...

    Quote Originally Posted by peter_k_john
    HI

    Try this link . Hope this will provide you necessary information you want.

    http://www.antonypranata.com/article...plication.html

    Regards,
    Peter
    Hi Peter,

    This is really a good link for me and I thought it would be the solution... until I have tested it and realized it was not working in my code... I am not able to find the bug but maybe you should tell me what is wrong in my modifications?
    Code:
    	RApaLsSession session;
    	User::LeaveIfError(session.Connect());
    	CleanupClosePushL(session);
    
    	// Gets the UID and MIME type for the given file name.
    	TUid uid;
    	TDataType dataType;
    	TPtrC8 ptrc8((TUint8*)"C:\\private\\F0205D9F\\matrix-ping-pong.3gp");//path);//
    	TFileName aFileName;
    	aFileName.Copy(ptrc8);
    	User::LeaveIfError(session.AppForDocument(aFileName, uid, dataType));
    
    	// Runs the default application using the MIME type, dataType.
    	// You can also use the UID to run the application. 
    	TThreadId threadId;
    	User::LeaveIfError(session.StartDocument(aFileName, dataType, threadId));
    
    	CleanupStack::PopAndDestroy(); // session
    (I have realized that I was completely wrong with the UID I gave you in my first post in this topic, looks like it is F0205FD9F or 10205FD9F but no one is working.)

    The result of this code is a call of RealPlayer like I had before, that means the main RealPlayer page and not the video I ask for to be played...

    Quote Originally Posted by kis_spn
    hi pwiit...

    Try to this code hope It'll help you....

    CDocumentHandler *iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );

    CleanupStack::PushL(iDocHandler);

    TDataType data = TDataType(KNullUid);
    TBuf<256>param;
    param.Copy(_L("c:\\Nokia\\Videos\\sample.3gp"));

    iDocHandler->OpenFileEmbeddedL(param,data);

    CleanupStack::PopAndDestroy();

    add this header file .....
    #include <documenthandler.h>
    and lib....commonui.lib
    I have tried your code, which is for the moment giving to me the best results, as I have Real Player starting on a specific window that really seems to be the one of the video playing... the only problem is that it is exiting at the moment it should start playing my video :'(. I give you my modified code for information, if you see a problem:
    Code:
    	CDocumentHandler *iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );
    
    	CleanupStack::PushL(iDocHandler);
    
    	TDataType data = TDataType(KNullUid);
    	TBuf<256>param;
    	param.Copy(_L("C:\\private\\F0205D9F\\matrix-ping-pong.3gp"));
    
    	iDocHandler->OpenFileEmbeddedL(param,data);
    
    	CleanupStack::PopAndDestroy();
    Anyway, thank you three for your replies, I am nearer than I have ever been of making it! I think that my problem should be in the path I give to realplayer (I don't believe it but after all I was sure about a completly wrong UID one hour ago...) but if you see a bug in my piecs of code, please tell me...

    Thank you again!

  6. #6
    Super Contributor
    Join Date
    Oct 2005
    Posts
    739

    Re: Opening RealPlayer on a video from a program

    Quote Originally Posted by pwiit
    Thank you everybody for your replies, that helps me a lot!

    I think that my problem should be in the path I give to realplayer (I don't believe it but after all I was sure about a completly wrong UID one hour ago...) !
    Did you tried by changing your Location of the file to a common folder like ("c:\\Nokia\\Videos\\.."..??

    Peter

  7. #7
    Registered User
    Join Date
    Mar 2007
    Posts
    9

    Re: Opening RealPlayer on a video from a program

    I could find why the kis_spn solution was not working well: the CleanUpStack::PopAndDestroy() is not waiting for the end of the video and killing it directly.

    So I have not put it in my program, I suppose that it is done when the Real Player app is exiting anyway...

    Anyway, I can now read video files! Thank you for you help everybody!

    EDIT: Looks like removing CleanUpStack::PopAndDestroy() is not a good idea after all, as some bugs are occuring (like a message saying it is not possible to uninstall the application because it is still running...)

    So I have added at the end of the piece of code the following:
    Code:
    	(...)
    	iDocHandler->OpenFileEmbeddedL(param,data);
    
    	CActiveScheduler::Start();
    	CleanupStack::PopAndDestroy();
    So the stack is cleaned but the CActiveSheduler::Start() makes sure that the application which has the hand (RealPlayer in my case) is giving it back before.
    Last edited by pwiit; 2007-05-22 at 09:26.

  8. #8
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    115

    Re: Opening RealPlayer on a video from a program

    Hi guys,

    I have the same problem and disccovered that there is
    something wrong with the path ...

    I 've tried both versions (1) kis_spn:
    Originally Posted by kis_spn
    hi pwiit...

    Try to this code hope It'll help you....

    CDocumentHandler *iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );

    CleanupStack::PushL(iDocHandler);

    TDataType data = TDataType(KNullUid);
    TBuf<256>param;
    param.Copy(_L("c:\\Nokia\\Videos\\sample.3gp")); my path: C:\\Data\\Videos\\path0001.3gp

    iDocHandler->OpenFileEmbeddedL(param,data);

    CleanupStack::PopAndDestroy();

    add this header file .....
    #include <documenthandler.h>
    and lib....commonui.lib
    and pwiit (2):
    Code:
    RApaLsSession apaLsSession;
    	const TUid RealPlayerUid = {0x10005A3E}; // 0x1020724D on 3rd Edition!
    	HBufC* param = HBufC::NewLC(64);
    	param->Des().Copy(_L("1 C:\\Data\\Videos\\path0001.3gp"));
    	TUid id(RealPlayerUid);
    	TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    	TApaTask task = taskList.FindApp(id);
    	if(task.Exists())
    	{
    		task.BringToForeground();
    		HBufC8* param8 = HBufC8::NewLC(param->Length());
    		param8->Des().Append(*param);
    		task.SendMessage(TUid::Uid(0), *param8); // UID not used
    		CleanupStack::PopAndDestroy(param8);
    	}
    	else
    	{
    		if(!apaLsSession.Handle())
    		{
    			User::LeaveIfError(apaLsSession.Connect());
    		}
    		TThreadId thread;
    		User::LeaveIfError(apaLsSession.StartDocument(*param, RealPlayerUid, thread));
    		apaLsSession.Close();
    	}
    	CleanupStack::PopAndDestroy(param);
    In the second case I could open the RealPlayer, but no files was specified
    In the first case I wasn't able open the player ... ?!


    Coud somebody help on this metter ?

    Thanks in advance
    Last edited by lucca99; 2007-10-29 at 02:40.

  9. #9
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Germany
    Posts
    115

    Re: Opening RealPlayer on a video from a program

    hi again..,

    could someone help ? it is probably a matter of
    a line, but it will help me a lot.

    I basically need to start a specific *.3gp file from my application..

    thx in advance

  10. #10
    Registered User
    Join Date
    Apr 2005
    Location
    Thailand
    Posts
    4

    Re: Opening RealPlayer on a video from a program

    hi
    pwiit, no need to pass parameter "1 " to real player
    just try

    param->Des().Copy(_L("C:\\private\\10005A3E\\matrix-ping-pong.3gp"));

    in your second code

    Br,
    sang

  11. #11
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Opening RealPlayer on a video from a program

    Quote Originally Posted by sang_sorn View Post
    hi
    pwiit, no need to pass parameter "1 " to real player
    just try

    param->Des().Copy(_L("C:\\private\\10005A3E\\matrix-ping-pong.3gp"));

    in your second code

    Br,
    sang
    Are you aware the original post is one year old?

  12. #12
    Registered User
    Join Date
    Apr 2005
    Location
    Thailand
    Posts
    4

    Re: Opening RealPlayer on a video from a program

    ha ha,
    I 've found this post by search engine. May be someone later me will find this post after me.. ^^

  13. #13
    Registered User
    Join Date
    Apr 2007
    Posts
    14

    Re: Opening RealPlayer on a video from a program

    If only everyone thinks like you!
    I only found this 1 year later.

    Quote Originally Posted by sang_sorn View Post
    ha ha,
    I 've found this post by search engine. May be someone later me will find this post after me.. ^^

Similar Threads

  1. J2ME fullscreen video or launch realplayer
    By anish_t in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2012-01-16, 21:53
  2. J2ME: Ways to play video in Landscape? Launch RealPlayer?
    By redlex in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2009-01-04, 17:31
  3. how to play video file on midlet program
    By mathi77in in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-07-16, 06:46
  4. Problem in opening a video...
    By anoopd in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-02-21, 15:22
  5. Unlimit video camera program
    By ahhue in forum Symbian C++
    Replies: 0
    Last Post: 2003-08-23, 13:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •