Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
hobby_johals
Posts: 105
Registered: 05-20-2011
My Carrier: Vodafone

Problem in playing audio file from URL

Hello members

I have an issue while playing an audio file from the URL.Please Help me out

 

i am getting Critical Tunnel Failure Exception

 

Here is my code snippet

 

 private class AudioPlaybackDemoScreen extends MainScreen
    {    
        public AudioPlaybackDemoScreen()
        {
            
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                
                public void run() {
                    // TODO Auto-generated method stub
                    // put your code here.
                    
                    try
                    {
                        Player p = javax.microedition.media.Manager.createPlayer("http://www.emp3world.com/to_download.php?id=124217");
                        p.realize();
                        VolumeControl volume = (VolumeControl)p.getControl("VolumeControl");
                        volume.setLevel(30);
                        p.prefetch();
                        p.start();
                 
                    }
                    catch(MediaException me)
                    {
                        Dialog.alert(me.toString());
                    }
                    catch(IOException ioe)
                    {
                        Dialog.alert(ioe.toString());
                    }
                }
            });

 


      }
     }

 

Please let me know if someone has any ideas           

Thanks

Amar
Please use plain text.
New Developer
hobby_johals
Posts: 105
Registered: 05-20-2011
My Carrier: Vodafone

Re: Problem in playing audio file from URL

Thnx i have solved my solution

Amar
Please use plain text.