02-10-2013 12:14 PM
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
02-11-2013 12:02 PM
Are you allowing access to the domain you are playing from in the config.xml?
02-11-2013 12:15 PM
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
02-11-2013 03:50 PM
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.
02-11-2013 04:54 PM - edited 02-11-2013 04:57 PM
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>
<rim
rientation 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