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
Developer
Posts: 193
Registered: ‎02-27-2009
My Device: Not Specified

Is HTML5 audio working on Playbook?

Can you play audio clips in your WebWorks app on a Playbook? I've tried the standard HTML5 audio player, and it does not work well. Let me point you to some public code to demonstrate. Try opening this in your Playbook browser:

 

Cut & Paste HTML5 Mouseover/ Click sound effect

 

On normal browsers, this works fine. You click some links to get a "click" sound. But on the Playbook 2.0 browser, I see the following misbehavior:

  • The sounds (a "whoosh" sound and a "click" sound) are all played on page load.
  • After the first click, each click plays the "click" sound twice.

Anyone know of a workaround for this audio behavior?

 

I've opened a case in RIM's JIRA (TABLET-501) but it's probably not visible to the public. 

 

 

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Is HTML5 audio working on Playbook?

Yes, HTML5 audio does work in a WebWorks app on PlayBook.

 

Note: the sample you provided make use of "mouseover" events, which may not behave as expected on touch-screen devices like the PlayBook (where there is no 'over' events).  The "whoosh" sound effect appears to be tied to the mouseover event.

 

Try this test page?

http://blackberry.github.com/WebWorks-Samples/kitchenSink/html/html5/audio.html

 

Note: not all audio codecs are supported by the Tablet OS web engine (e.g. OGG format is currently not available but is on the roadmap).

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: Is HTML5 audio working on Playbook?

I've noticed this is a problem too.

I'm not sure what the audio type is, but videos on Comedy Central will play audio fine in the browser, but will NOT play audio if you visit the page within a webworks apps.

If you want to try it for yourself, sideload the app at http://opensourcebb.com/2012/03/tablet-tv-playbook-app-by-scrapps/ and try to view a video from Comedy Central. There will be no audio. Viewing the same video works fine using the stock browser.

-----------------------------------------------------------------------------------------



Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Is HTML5 audio working on Playbook?

WebWorks apps need to white list any external domains used to access remote content.  if the audio files exist on a different domain than that of the paget they are being played from, they will not play from within a WebWorks app unless you have both domains whitelisted in the config.xml file.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: Is HTML5 audio working on Playbook?

I have all subdomains and urls allowed in my app.
-----------------------------------------------------------------------------------------



Developer
Posts: 193
Registered: ‎02-27-2009
My Device: Not Specified

Re: Is HTML5 audio working on Playbook?

Thanks for responding. I think you misunderstood the problem I am experiencing in the original link. The audio demo does indeed have a mouseover demo, but it also has "click" demos (tap on the "click" links). Please try the click demos with your Playbook. You will find that even with the "click" sounds, the Playbook plays the audio incorrectly. 

 

I tried the test page you provided. The difference with that test page is that it only has longer audio samples. The problem I am describing has to do with short sound clips, such as those for sound effects. I tried the exact same <audio> tags as in that page, and saw the same problems if I used shorter audio files. 

 

The Playbook can handle HTML5 audio in static media demos. But it cannot correctly handle short audio clips. Its inability to correctly play sound effects -- such as those used for games -- severely cripple the Playbook as a Webworks platform.

Contributor
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: Is HTML5 audio working on Playbook?

@cwong15 Did you ever get anywhere with this? I have created a new thread here with my findings and what I've tried to do to get around this. 


Basically I have found that you can a) reload the sound after it has been played the first time, b)create a new instance of the sound every time.  

 

Neither of theses are ideal. Solution a) causes a lag while the sound is loaded and solution b) causes a new instance of the sound taking up more memory each time.

 

This seems to be an issue with the playbook. I've seen this behavior in the browser as well as webworks. I'm surprised to find little information on this problem. 

Developer
Posts: 193
Registered: ‎02-27-2009
My Device: Not Specified

Re: Is HTML5 audio working on Playbook?

Nope, I had no luck finding any workaround. I ended up abandoning my project. 

 

The JIRA issue I filed on this in February is still in "triage" status, so I guess nothing is happening any time soon. In case you're interested, the issue is: TABLET-501

Highlighted
Contributor
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: Is HTML5 audio working on Playbook?

[ Edited ]

I posted my work around in the thread I started if you decide to resurrect your project. 

Developer
Posts: 193
Registered: ‎02-27-2009
My Device: Not Specified

Re: Is HTML5 audio working on Playbook?

Thanks. Your solution looked promising. I'll follow up in your thread.