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 Developer
mbilimoria
Posts: 3
Registered: ‎10-20-2009
My Device: Not Specified

Playing MP3 from server

Is there a way you can play mp3 direction from my website? Same way as we can play audio in iphone using

 

 

<embed target=""myself"" src=""play-button.gif""  href=""{0}"" width=""300"" height=""300"" autoplay=""true"" 

                                type=""audio/mp3"" qtnext1="a.mp3">

 

</embed>

 

 

 

 

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Playing MP3 from server

Yes, you can use the object tag to embed media in your web content.

 

Please see this article article from the BlackBerry Developer's blog which describes how this can be implemented:

http://supportforums.blackberry.com/t5/BlackBerry-Developer-s-Blog/BlackBerry-Browser-Embedded-Media...

 

In your example, I would recommend using the following html:

 

<object data="a.mp3" type="audio/mpeg" width="300" height="300"/>

 

Sincerely,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Developer
mbilimoria
Posts: 3
Registered: ‎10-20-2009
My Device: Not Specified

Re: Playing MP3 from server

Thanks for your reply. 

 

Can you play a playlist?

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Playing MP3 from server

Yes it can.  Create a playlist file using the Media Player and use that filename in the data property of the object method.

 

For example:

 

<object border="0" type"audio/mpeg" data="Test_playlist.m3u" height="50px"/>

 

where the contents of "Test_playlist.m3u" might look like the following:

 

file:///SDCard/BlackBerry/music/song1.mp3

file:///SDCard/BlackBerry/music/song2.mp3

file:///SDCard/BlackBerry/music/song3.mp3

 

The browser application will invoke the media player to the URL of the corresponding song in the playlist.

 

Enjoy.

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Developer
mbilimoria
Posts: 3
Registered: ‎10-20-2009
My Device: Not Specified

Re: Playing MP3 from server

Can songs path be from some website?

Please use plain text.