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
New Developer
Posts: 13
Registered: ‎01-05-2012
My Device: Bold 2
My Carrier: GLO

Stream Audio In Webworks

Have been trying to stream an audio in webworks to no avail.

The audio stream perfectly well in the Blackberry browser

But  when i complie the app and run it in the simulator and on actual blackberry device, the app opens after i click the play button nothing happens.

 

Pls how do i get this fixed.

I have already whitelisted the stream url

New Contributor
Posts: 6
Registered: ‎01-22-2013
My Device: 9850 / 9930 / PlayBook
My Carrier: Verizon

Re: Stream Audio In Webworks

Are you allowing access to the domain you are playing from in the config.xml? 

New Developer
Posts: 13
Registered: ‎01-05-2012
My Device: Bold 2
My Carrier: GLO

Re: Stream Audio In Webworks

Yes I allowed access to the domain it is a shoutcast server  and the url of the provider is voscast.com

This is how i allowed access to the domain in my config.xml file

 

<access uri="http://voscast.com" subdomains="true">
</access>

 

The funiniest thing is that it plays in the blackberry simulator browser but once i compile it, it doesn't play in the simulator

Highlighted
Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: Stream Audio In Webworks

Audio might not work well in the simulator, this is a known issue. Have you tried it in Ripple? Does it work there? If so, perhaps you could test it out on a device and give it a shot. Worst case post some code here so we can help you debug it.

 

@erikjohnzon
erjohnson@blackberry.com
New Developer
Posts: 13
Registered: ‎01-05-2012
My Device: Bold 2
My Carrier: GLO

Re: Stream Audio In Webworks

[ Edited ]

Yes, i tried it in ripple and it worked perfectly well.

I uploaded toe code to a test server and tried playing it using the Simulator browser and it worked perfectly.

But once compiled it didnt worked on the simulator and on a real device.

 

Find attached some code.

 

 

Part of my config.xml file

 

<content src="index.html" />
<access uri="http://voscast.com" subdomains="true">
<feature id="blackberry.app" version="1.0.0.0" required="true"/>
</access>
<rimSmiley Surprisedrientation mode="portrait" />
<rim:connection timeout="25000">
<id>MDS</id>
<id>BIS-B</id>
<id>TCP_WIFI</id>
<id>TCP_CELLULAR</id>
</rim:connection>

 

Part of my index.html file

 

<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta id="viewport" name="viewport" content="user-scalable=no, width=device-width" />
<link href="skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jplayer.js"></script>

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){

var stream = {
mp3: "stream url"
},
ready = false;

$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
ready = true;
$(this).jPlayer("setMedia", stream);
},
pause: function() {
$(this).jPlayer("clearMedia");
},
error: function(event) {
if(ready && event.jPlayer.error.type === $.jPlayer.error.URL_NOT_SET) {
// Setup the media stream again and play it.
$(this).jPlayer("setMedia", stream).jPlayer("play");
}
},
swfPath: "js",
supplied: "mp3",
wmode: "window",
autoPlay:"false",
preload: "false"
});

});
//]]>
</script>

 

 

I am making use of jquery and jplayer they are both located in the root of my app folder