List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development
Showing posts with label Play Audio From URL. Show all posts
Showing posts with label Play Audio From URL. Show all posts

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());
                           
                        }