How to disable subtitles in Android MediaPlayer?

Actually the whole point of the question reflected in the title.
There is streaming video, which I can't change. It does have subtitles. In Android 4.4 they appear on version 5.0 no. How to turn off on 4.4?
Use system MediaPlayer
July 9th 19 at 10:11
1 answer
July 9th 19 at 10:13
Solution
So the answer myself. Briefly, the answer looks like this:

for(int i = 0; i < mMediaPlayer.getTrackInfo().length; i++ ){
 MediaPlayer.TrackInfo trackInfo = mMediaPlayer.getTrackInfo()[i];
 if(trackInfo.getTrackType() == MediaPlayer.TrackInfo.MEDIA_TRACK_TYPE_TIMEDTEXT){
mediaPlayer.selectTrack(i);
mediaPlayer.deselectTrack(i);
}
}


Now describe what's happening here.
After the player has loaded the data, it is possible to request a list of available tracks (video, audio, subtitles). Each track can be selected (playing) and deselected (not playing). At the start of the player, the track with the audio and video automatically get the status selected and the others deselected. In Android 4.4 (on the TV Box which I work) for some reason the track with the subtitles still playing, even despite the fact that it is not selected.
To disable this track, it is necessary to first find the array of all the tracks, and then assign a selected status immediately to clean it up. Thus we completely turn off this track from playing.
Attention! When trying to invoke mediaPlayer.deselectTrack(i); the track, which was not selected, a RuntimeException will be thrown which is not mentioned in the documentation!
Well, the original article about MediaPlayer where can I learn more about the methods mediaPlayer.selectTrack(i); and mediaPlayer.deselectTrack(i);
Attention 2! In AOSP there is a bug, drop the player on some videos with embedded subtitles. Panel discussion AOSP
At the moment the solution is unknown

Find more questions by tags Android