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
Highlighted
Developer
Posts: 16
Registered: ‎10-18-2010
My Device: Not Specified
Accepted Solution

Sound will NOT play.

I have scanned a few threads here about sound some claim to have fixes but nothing has worked for me so far.

 

From my config.xml

 

  <feature id="blackberry.audio.Player" />

Script:

var playerInstance = new  blackberry.audio.Player("local:///woosh.mp3","audio/mpeg", true); playerInstance.play();

 

I've tried adding the playerInstance.play(); tag to where I need it within my app but it always fails even on actual devices. Is there something obvious that I am missing or is the API broken?

Developer
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: Sound will NOT play.

First, put these 2 lines of the feature element completely:

 

<feature id="blackberry.audio" version="1.0.0.0"/> 
<feature id="blackberry.audio.Player" version="1.0.0.0"/> 

 Second, put the mp3 file in the root folder of your application.

New Developer
Posts: 13
Registered: ‎10-19-2010
My Device: 9000
My Carrier: AT&T

Re: Sound will NOT play.

This works for me:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>File I/O Example</title>
    <meta name="HandheldFriendly" content="True" />

    <script type="text/javascript">
      var playerInstance;
        function initialLoad() {
          playerInstance = new  blackberry.audio.Player("local:///sounds/beep.mp3","audio/mpeg", true); 
          // Hint: crashes here if file isn't found
          // despite posting below, it does NOT have to be at the root
          // this will NOT work if your surf to this page - you MUST be embedded and MUST be (i guess) on your original page.
              
        }
    </script>
</head>
<body onload="initialLoad()">
  <a href="javascript&colon;playerInstance.play();">play</a>
  
  <br/>Amazingly, this works.  
  
  <p>
    see: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Sound-will-NOT-play/td-p/1098623
</body>
</html>