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: 66
Registered: ‎05-27-2009
My Device: Not Specified
Accepted Solution

Play Audio on a webpage

Hi there,

We want to make our website which has embeded audio player available to our BB users. I am totally new to BB, so even don't know where to start. Currently our webpages are written in PHP and Javascript. The embeded player is Windows Media Player(for web). My questions are:

 

1. Do we need to re-create our web pages using other languages, like Java or ASP.NET?

 

2. Which embeded player can we use?

 

3. Can we stream the audio (our clients may use different types of browsers on their BB, we'd better streaming the audio instead of allowing them to download).

 

4. Is there any tutorial or white paper related to how to write dynamic web pages for BB?

 

Thanks a lot!

 

Helen 

Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

I just find out that BB browser does soppurt <object> element. What's the classid for the embedded player if there is any? Thanks a lot!

 

Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: Play Audio on a webpage

[ Edited ]
1) No, you shouldn't have to. As long as it outputs HTML it doesn't matter what language you're doing it in.

2) There's a built-in media player on the blackberry.

3) I believe so.

4) Not that I'm aware of.

You can use the <object> tag with the appropriate content-type to have it play using the built-in media player if the type is supported. Just use the object tag as usual: <object data="myfile.wmv" type="audio/x-ms-wmv">Error: format not supported</object>. (I'm assuming wmv format, replace the type with whatever you're actually using).
Message Edited by staktrace on 2009-05-28 08:03 AM
Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

Thanks staktrace! So glad to know there is a built-in media player! I have some more questions:

 

1. We don't have to provide the classid for the built-in player?

 

2. Is the build-in player embeddable?

 

3. I don't have a BB, how to test to pull the URL from it? It seems that there's BlackBerry simulator when downloading BlackBerry JDE. Is there a standalone BB simulator?

 

Many thanks!

Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

I just found the place to download the simulators from BB's website. Haven't test it yet. Hope they'll work. Questions about the built-in media player remain. Thanks a lot!
Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

Seems that I cannot get the simulator to work! I just installed BB 9000 simulator. When ran it(9000-Vodafone.bat on the command line console), I went through a setup wizard but no keyboard or trackball (when I moused over the bottom part of the simulator, I saw some displays of charactors etc). I'm not sure where's the menu key or how to open it. I did see "Files", "View" ... menu items on the top of the simulator.

 

I just want to test some websites on BB Browser. What're the step to do so from the very begining? Thanks a lot!

Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

Download another one and it worked!
Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

I guess this thread is in mess now. Please ignore my questions on the simulator. Allow me refresh the questions:

 

1. Is there any embeded media player for Blackberry Browser?

 

2. I tried to create a website to play music, but the "object" element didn't work.

 

3. I used <a href> instead, and the music played if it's pulling from a web server, but steaming from a Windows Media Service didn't.

 

Basically, the following code says my questions of 2 and 3:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="HandheldFriendly" content="true" >
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>BB Media Test</title>

</head>

<body>
       <a href="http://my_host/sample.mid">play music link</a><br />    <!-- music plays but the player is not embeded -->

 
      <a href="http://windows_media_server_ip/test_publishing_point/pinball.wmv">play video </a><br />    <!-- got error: Unsupported media type: video/x-ms-wvx -->

 

   <a href="http://windows_media_server_ip/test_publishing_point/sample.mid">stream audio </a><br />   <!-- got error: Unsupported media type: video/x-ms-asf -->


   
    <object data="http://my_host/sample.mid" type="audio/mid"><param name="autoplay" value="true" /></object>   <!-- ignored -->

   
</body>
</html>

 

 

 

Have to say that I am very beginner on BlackBerry applications. Thanks a lot for any help!

Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: Play Audio on a webpage

When you say "ignored" what do you mean? Does it not show anything at all? Try putting some text inside the object tag and see if that shows up (if the browser can't render the object it is supposed to render the content as fallback):

<object data="foo.mid" type="audio/mid">MIDI not supported</object> 

Developer
Posts: 66
Registered: ‎05-27-2009
My Device: Not Specified

Re: Play Audio on a webpage

Thanks Staktrace!

 

I finally figured out that it should be "autostart" instead of "autoplay".

 

But if the errors to the links are still there. Any clue? Thanks!