Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 237
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel
Accepted Solution

Is there any change to use mediaPlayer with InvokeManager?

Hi I'm using mediaPlayer with InvokeManager to play video streaming

But recently the mediaPlayer cannot play the file

Might because update to new OS

 

this is my function

void DetailPage::invokeMediaPlayer(QString aUrl)
{
InvokeManager invokeManager;
InvokeRequest request;
request.setTarget("sys.mediaplayer.previewer");
request.setAction("bb.action.OPEN");
request.setUri(QUrl(aUrl));
InvokeTargetReply *reply = invokeManager.invoke(request);
}

 When I read the documentation about new update (release note)

 

App integration (invocation framework) - In order to properly support extended character sets, the invocation framework has updated its URI handling to enable clients and targets to better coordinate their use of URIs. The invocation framework now expects valid URIs to be passed in their encoded form to enable the targets to interpret them properly. For non-file URIs, the updated handling ensures that the framework does not alter the URIs and delivers them as-is. With this change, the targets receiving URIs in invocations should expect to receive encoded URIs and are required to decode them.

 

 

What I must change on my code?

Before was work fine

 

 

Thanks

 

 

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Is there any change to use mediaPlayer with InvokeManager?

I'm using the MediaPlayer this way:

void OpenDataSpace::invokeBoundMediaPlayer(const QString& uri) {
	InvokeRequest cardRequest;
	if (uri.startsWith('/')) {
		cardRequest.setUri("file://" + uri);
	} else {
		cardRequest.setUri(uri);
	}
	cardRequest.setTarget("sys.mediaplayer.previewer");
	mInvokeManager->invoke(cardRequest);
}

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 237
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel

Re: Is there any change to use mediaPlayer with InvokeManager?

Sorry actualy there is an error on my video webservice.

 

So there is nothing wrong with mediaPlayer on new SDK (10.0.9.2318)

 

Thanks