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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Trusted Contributor
icecappacino
Posts: 152
Registered: ‎02-12-2011

Streaming Audio using HTML5 Audio

I have a streaming service which supports mp3 and aac/acc+ streaming.

 

I'm trying to use the following code to stream a radio station but to no avail( using simulators OS7)

 

 

function init(){ alert('ok 1');
audio = document.createElement('audio');
audio.setAttribute('autoplay', 'true');
audio.setAttribute('preload', 'true');
audio.setAttribute('controls', 'true');
audio.setAttribute('id','audio');
audio.src='http://ice2.securenetsystems.net/WPBRADIO?type=.aac&playSessionID=FCAD1DD9-3048-56A6-CA398BF4695704D... ;
audio.load();
alert('ok 2');
audio.addEventListener("load", function() {
alert('ok 3');
audio.play();
}, true);
audio.addEventListener("canplay", function() {
alert('ok 4');
audio.play();
}, true);
document.getElementById('audioPlayer').appendChild(audio);
}

 

I get alerts "ok 1" and "ok 2" but not 3 and 4

 

I might add that in the blackberry browser this does seem to work...

 

I have infact provided the necessary access permissions

Please use plain text.
Trusted Contributor
icecappacino
Posts: 152
Registered: ‎02-12-2011

Re: Streaming Audio using HTML5 Audio

Just an update,

 

in trying to listen for audio events I seem to be getting a "stalled" event in the webworks app. Yet in the blackberry browser it plays fine...

 

can webwork stream audio ? Is it allowed too? I thought you didn't need permission to use the html5 audio?

Please use plain text.
Administrator
astanley
Posts: 1,127
Registered: ‎07-02-2009
My Carrier: Bell

Re: Streaming Audio using HTML5 Audio

Can you confirm that you have properly whitelisted the http://ice2.securenetsystems.net domain in your webworks config.xml document?

 

Supported Media types:

 


Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.

Watch the BlackBerry Jam Americas Sessions.
Please use plain text.
Trusted Contributor
icecappacino
Posts: 152
Registered: ‎02-12-2011

Re: Streaming Audio using HTML5 Audio

Yes...it is...The confusion here is that it works in the blackberry browser. I want to believe there is something to do with the feed but Can't help but think there is something wrong with the Webworks ability...given its flaws

Please use plain text.
Developer
burakk
Posts: 87
Registered: ‎04-23-2011
My Carrier: Turkcell

Re: Streaming Audio using HTML5 Audio

Hello icecappacino,

 

Have you been able to make it work?

 

Thank you.

Please use plain text.
Contributor
mikebevz
Posts: 17
Registered: ‎04-19-2012
My Carrier: Telenor Denmark

Re: Streaming Audio using HTML5 Audio

Hi,

 

I've got exactly the same problem. 

 

Audio tag works in browser, but not in the app. It calls "Stalled" and no go. 

 

All the needed domains are whitelisted.

Have you guys solved this problem? 

Please use plain text.