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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 6
Registered: ‎05-19-2011
My Device: playbook
My Carrier: no
Accepted Solution

webworks invoke

[ Edited ]

is it possible to launch media player invoke.JavaArguments using http://blackberry-webworks.github.com/WebWorks-API-Docs/WebWorks-API-Docs/view/blackberry.invoke.Jav... ?

 

i've tried following method with no success:

 

function launch_media_player()
{
   try
       {
            var params = new Array();
            params[0] = 'http://somesite.com/somefile.mp3
            var args = new blackberry.invoke.JavaArguments('net_rim_bb_mediacontenthandler', params);
            blackberry.invoke.invoke(blackberry.invoke.APP_JAVA, args);
       }
   catch (e) {
    alert('exception (launch_media_player): ' + e.name + '; ' + e.message);
   }
}

launch_media_player();

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: webworks invoke

No that is not possible.  The reason why is because most apps created by RIM (e.g. media player) do not allow 3rd party applications to feed them parameters.  This is why the blackberry.invoke.APP_MUSIC constant was provided so you could invoke directly to the media player (but no params unfortunately).

 

With your code, I might expect the media player could be opened, by targeting the module directly, but it would not start playing somefile.mp3.  Is that what you are seeing?

 

Are you targeting BlackBerry 7?  If so you may be able to use the HTML5 audio element instead.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Developer
Posts: 6
Registered: ‎05-19-2011
My Device: playbook
My Carrier: no

Re: webworks invoke

thanks for such complete answer, and sorry for such a big delay Smiley Happy