List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development

Tuesday, August 21, 2012

Play Audio From URL in Blackberry

The following code will help you to playing an audio from url.

                       try {
                         String httpURL="http://www.yourwebsite.com/audio.mp3";
                         if ((WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
                                    && RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN)) {
                                httpURL += ";interface=wifi";
                            }
                       
                            Player player;
                            player =Manager.createPlayer(httpURL);
                            player.realize();
                            player.prefetch();
                            player.start();
                           
                        } catch (Exception me) {
                            Dialog.alert(me.toString());
                           
                        }


        

2 comments:

  1. give the following error

    javax.microedition.media.MediaException: unsupported content type - text/html

    ReplyDelete