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
Trusted Contributor
Posts: 152
Registered: ‎02-12-2011
My Device: Not Specified

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

Trusted Contributor
Posts: 152
Registered: ‎02-12-2011
My Device: Not Specified

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?

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
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.
Trusted Contributor
Posts: 152
Registered: ‎02-12-2011
My Device: Not Specified

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

Developer
Posts: 149
Registered: ‎04-23-2011
My Device: BlackBerry 9700 Bold
My Carrier: Turkcell

Re: Streaming Audio using HTML5 Audio

Hello icecappacino,

 

Have you been able to make it work?

 

Thank you.

Contributor
Posts: 17
Registered: ‎04-19-2012
My Device: Torch
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? 

Developer
Posts: 26
Registered: ‎12-26-2012
My Device: Q10
My Carrier: Sprint

Re: Streaming Audio using HTML5 Audio

Same issue. Stream stops after about 5 second. Any workaround?
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Streaming Audio using HTML5 Audio

Cna you confirm if this behavior is happening to you on PlayBook, or on BlackBerry 10?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 26
Registered: ‎12-26-2012
My Device: Q10
My Carrier: Sprint

Re: Streaming Audio using HTML5 Audio

Blackberry 10.

And yes Domain is whitelisted
Retired
Posts: 165
Registered: ‎09-24-2012
My Device: Passport
My Carrier: Bell

Re: Streaming Audio using HTML5 Audio

Hi YoelyG,

 

I've loaded this up into a WebWorks application, and it's working as designed, both "load" and "canplay" triggers and sound plays. Here's my access permission in config.xml.

 

<access uri="http://securenetsystems.net" subdomains="true"/>

 Please provide me your device OS version(s) so I can retest there, as it appears to work fine on my 10.1 build.