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

Web and WebWorks Development

Reply
o0
Contributor
Posts: 26
Registered: ‎05-13-2010
My Device: developper...
My Carrier: developper...

start media player from Web Widget

Is there a working example somewhere on how to use the Javascript blackberry.invoke object to launch applications from within a Web Widget application?

 

I need to be able to launch the web browser for some external urls, and after a pretty depressing read on the issues of web video playback, I wonder if I can launch the Media player with a http://...mp4 url as well.

 

Any ideas on how to proceed?

 

oO

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: start media player from Web Widget

I believe if you set the location.href of your widget to the URL of an MP3 file it will automatically launch in the Media Player

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
o0
Contributor
Posts: 26
Registered: ‎05-13-2010
My Device: developper...
My Carrier: developper...

Re: start media player from Web Widget

my Web Widget is all contained within a single html file with javascript managing the application completely. I can't set the document location without loosing my app. I would rather launch the media player myself and give the path to the file to play.

 

Is it possible to launch the mediaplayer from inside the widget? maybe using the

 

 var args = new blackberry.invoke.JavaArguments(<MEDIAPLAYER>);
blackberry.invoke.invoke(blackberry.invoke.APP_JAVA, args); // Java

 

As an alternative, would starting the web browser and passing the url of a h.264 video file make the web browser itself delegate to the media player?

 

oO

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: start media player from Web Widget

Invoking the browser will accomplish what you are looking to do:

 

 

var args = new blackberry.invoke.BrowserArguments('http://myurl');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
o0
Contributor
Posts: 26
Registered: ‎05-13-2010
My Device: developper...
My Carrier: developper...

Re: start media player from Web Widget

I tried that, and I get a HTTP Error 413: Request entity too large...

 

It looks like it's just trying to download the entire file (11MB?!?) and failing. Video is

 

http://www.hollywoodbowl.com/media/video/flv/grease_edit.mp4 and playback is fine on iPhone and Android versions of the same app :-(

 

oO