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
New Contributor
Posts: 4
Registered: ‎08-03-2011
My Device: BB - 9850
My Carrier: dasda
Accepted Solution

HTML5 audio tag....

Hi, 

 

Using HTML5 audio tag for my player in the application. However, onended event is not working in BB.

 

Using following HTML5 tag.

 

<audio  autoplay="autoplay" controls ="controls" onended ="window.location.reload(true);">       

<source src="{name_of_mp3_file" type="audio/mpeg" />       

Audio element not supported.     

</audio>

 

When song ends, the page should refresh. However, in blackberry page is not refreshing.

 

In Iphone and Android browsers. I am getting the desired results..

Please help in resolving this issue.

 

Thanks in advance..

 

 

 

Contributor
Posts: 41
Registered: ‎07-21-2011
My Device: Superberry
My Carrier: Rogers

Re: HTML5 audio tag....

Hi sid,

Which version of BB are you running this code on? I just tried an HTML5 audio tag in the 7.0 simulator that we distribute with WebWorks and it works by spawning the media player. No event is fired at the end since the music is played outside the browser.

I used this code to test, is it similar to what you have?

<html>
<body>
<audio autoplay="autoplay" controls ="controls" onended ="alert('onended!')">
<source src="http://www.robtowns.com/music/blind_willie.mp3" type="audio/mpeg" />
Audio element not supported.
</audio>
</body>
</html>
----------------------------------------------------------------------------------------------
I kode for cudos! Or was it the other way around?
New Contributor
Posts: 4
Registered: ‎08-03-2011
My Device: BB - 9850
My Carrier: dasda

Re: HTML5 audio tag....

[ Edited ]

Thanks for the reply...

 

I am using BB 9850 simulator  OS 7.0.

 

Previously, I have not read it completely..

That means in BB browsers no event of  audio tag will be fired  on BB..

 

Highlighted
Contributor
Posts: 41
Registered: ‎07-21-2011
My Device: Superberry
My Carrier: Rogers

Re: HTML5 audio tag....

That's also a 7.0 device, so I'd expect that you also see the Media Player pop up to handle your file play. If that's the case, the HTML 5 audio tag can't fire the onended event because it doesn't know when the file has ended.

Is your file local to the app or remote?
----------------------------------------------------------------------------------------------
I kode for cudos! Or was it the other way around?
New Contributor
Posts: 4
Registered: ‎08-03-2011
My Device: BB - 9850
My Carrier: dasda

Re: HTML5 audio tag....

Thanks for the replies...

I was able to get the solution from your replies.

Now I need to take some other approach in order resolve the issue.

 

Once again Thanks...

Contributor
Posts: 41
Registered: ‎07-21-2011
My Device: Superberry
My Carrier: Rogers

Re: HTML5 audio tag....

You're welcome, glad to be of help.
----------------------------------------------------------------------------------------------
I kode for cudos! Or was it the other way around?