Android MediaPlayer W / MediaPlayer: Info / Warning (703, 203)

I want to make an example of a radio player, but I have some bugs. I cannot fix this.

My source code

String url = ""; //Shoutcast Radio URL
    mp = new MediaPlayer();
    mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
    try {
        mp.setDataSource(url);
        mp.prepare();
    } catch (IllegalArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SecurityException e) {
        // TODO Auto-generated catch block
        Log.e(TAG, "SecurityException");
    } catch (IllegalStateException e) {
        // TODO Auto-generated catch block
        Log.e(TAG, "IllegalStateException");
    } catch (IOException e) {
        // TODO Auto-generated catch block
        Log.e(TAG, "IOException");
    }

      

My error (Logcat)

E/MediaPlayer﹕ Should have subtitle controller already set
W/MediaPlayer﹕ info/warning (703, 203)
W/MediaPlayer﹕ info/warning (701, 0)
W/MediaPlayer﹕ info/warning (702, 0)
W/MediaPlayer﹕ info/warning (702, 0)

      

+3


source to share


2 answers


"Must have subtitle controller already installed" is just a warning, not an error. It refers to a new implementation of MediaPlayer in Android Kitkat 4.4 (they added subtitle capabilities for videos, but for some reason it tries to use subtitles even if the media is just audio).

So, you can simply ignore this warning.



If it doesn't play, you can try using the OnPreparedListener right after mp.prepare (); with mp.start () ;:

mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
    @Override
    public void onPrepared(MediaPlayer mediaPlayer) {
        mp.start();
    }
});

      

+1


source


Having the same problem, we apparently cannot solve it according to:



http://www.piterwilson.com/blog/2014/03/11/android-mediaplayer-not-quite-there-yet/

0


source







All Articles