Android MediaPlayer class warning: Should have subtitle controller already set

3

After updating to Android KitKat (4.4), an object of class MediaPlayer Android generates the following alert in LogCat :

  

Should have subtitle controller already set

As explained in that question of the OS, it would suffice to call the setSubtitleAnchor method of the MediaPlayer class, as the example provided does, that the alert would disappear.

This alert does not cause me any harm, I do not care to leave it there, after all nothing bad happens, no exceptions, no visual messages to the user, but I would still like to delete it.

However, I looked in class documentation MediaPlayer , already considering API Level 19 , and I could not find the setSubtitleAnchor method.

Is there another way to make this alert no longer generated by the MediaPlayer class? Or, how to find this method setSubtitleAnchor ?

* Noting that my instances of class MediaPlayer are all used to play audio only, no video type is ever played.

    
asked by anonymous 18.05.2014 / 21:59

1 answer

2

Well, after a lot of trying, and searching, the best solution I've found is to ignore the message altogether, as it says this response from SO (a free translation / summary):

  

Some Google developer added subtitle support in VideoView .

     

When MediaPlayer starts playing a song it checks to see if there is a SubtitleController and displays this message if it does not exist, regardless of the source being an audio or video.

     

Short answer : Ignore this "exception"

Still according to this answer, this is still present in Lollipop, and the only way to remove this alert is to use Reflection to access the hidden method setSubtitleAnchor of class MediaPlayer . / p>

In my case, I'd rather not have to do this, and since this message is just a information and not an exception / alert (as LogCat says), I'll simply ignore the message for the whole always.

    
26.06.2015 / 22:32