BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 04-13-2008, 09:47 PM   #1 (permalink)
New Member
Join Date: Nov 2007
Model: 8800
Carrier: Nextel
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to play radio by URL

Please Login to Remove!


I'd like to start a radio streaming on the BlackBerry MediaPlayer by a URL streaming source.

The problem is I can't get the MediaPlayer loaded.

Has anyone an idea how to handle this?

I followed the code from the BlackBerry Developers Guide but I can't get it started. Here is my code:

 private void doPlayMusic(){
    String url = "";

    MediaManager manager = new MediaManager();
    MediaPlayer player = new MediaPlayer();
    try {
      Object media = manager.createMedia(url);
    } catch (IOException ioe) {
      System.out.println("Error: requested content was not downloaded.");
    } catch (MediaException me) {
      System.out.println("Error: " + me.getCode());
    // start media player

    // play content
    if(player.getState() == MediaPlayer.REALIZED) {
      try {
        } catch(MediaException me) {
          System.out.println("Error occurred during media playback: " +
          me.getCode() + me.getMessage());
Thanks for any suggestions!

Last edited by Hampshire : 04-13-2008 at 09:48 PM.

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.