09-06-2012 04:28 PM
09-06-2012 05:50 PM
Hi!
check the API for HTML5 Audio element, you can use it to play streaming audio ![]()
cheers
09-07-2012 12:54 AM
The best way, like Nuno said, is using HTML5 audio. An example looks like this:
var audio = document.createElement('audio');
audio.src="URL2YourAudioStream";
audio.play();
09-07-2012 08:35 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="HandheldFriendly" content="true" >
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>BB10 Web Audio Test</title>
</head>
<body>
<div id="container">
<button id="play_button" onclick="play(); return false;">Play</button>
</div>
</body>
<script>
var audio = document.createElement('audio');
function play() {
audio.src="http://www.frenchkissfm.com";
audio.play();
}
</script>
</html>
I make a sample code but don't work ... where I went wrong?
09-07-2012 08:48 AM
09-07-2012 09:20 AM
For the config.xml I do not know if you need something since I do not know how it looks like.
For your sample code:
function play() {
audio.src="http://www.frenchkissfm.com";
audio.play();
}
you do not really understand how it works, isn't it? The audio.src needs to get the source of the stream, not the source of your website since it doesn't understand HTML and will not be able to play anything. I think there should be an error output shown in the Web Inspector. I Inspected the page and it seems your stream is available @"stream.frenchkissfm.com:80/;stream.nsv", isn't it?
09-07-2012 06:49 PM
Your config.xml will need the access element for allowing your app to access the external web content, ie: the stream.
09-10-2012 08:30 AM
>>I need to edit a config.xml and insert code?
Yes, you will need to add an access element to your config.xml document in order to whitelist an external domain.
here is the documentation for the <access> element:
https://developer.blackberry.com/html5/documentati