MediaPlayer : Should have subtitle controller already set: KitKat MediaPlayer : Should have subtitle controller already set: KitKat android android

MediaPlayer : Should have subtitle controller already set: KitKat


Looking at a previous discussion on StackOverflow, and the referenced Android commit where this was introduced, the code above might not completely initialize the MediaPlayer object.

The KitKat example code for media playback suggests that you should call:

mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

immediately after you construct the MediaPlayer, and before you call its setDataSource method.


I had the same issue and I fixed it by adding the following right after instantiating MediaPlayer.

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

Previously I was implementing MediaPlayer.OnPreparedListener and overriding onPrepared() but it didn't work.

I hope this helps!


This should fix your problem (did for me): Replace the line that says "player.start()" following the rest of your code with an async callback like so:

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

This error is just a Log.e, not a real error. It shouldn't cause your player to not play, I'm guessing it's just because the player hadn't finished preparing when you try to call start().

E/MediaPlayer﹕ Should have subtitle controller already set