Android Mediaplayer class alert: Should have Subtitle controller already set

Asked

Viewed 426 times

3

After I upgraded to Android Kitkat (4.4), a class object MediaPlayer Android generates the following alert on Logcat:

Should have Subtitle controller already set

As explained in that question of the SO, just call the method setSubtitleAnchor class MediaPlayer, as per the example provided makes, that the alert would disappear.

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

However, I searched the class documentation MediaPlayer, already considering the API Level 19, and I couldn’t find the method setSubtitleAnchor.

There is another way to make this warning no longer generated by the class MediaPlayer? Or how to find this method setSubtitleAnchor?

*Emphasizing that my class instances MediaPlayer are all used to play only audio, no kind of video is played at any time.

  • 1

    I just edited it to give the question one more chance, it was hard to find something that could be edited :)

  • @bigown Thanks! I’ve kind of given up on this! I haven’t found any solution to this until today, other than ignoring Warning! P

  • 1

    @bigown more than a year has passed, and only now have I been able to answer in order to cure my curiosity :)

1 answer

2


Well, after a lot of trying and searching, the best solution I’ve found is to ignore the message completely, as you say that response from the OS (a free translation/summary):

Some Google developer added subtitle support on VideoView.

When the MediaPlayer starts playing a song it checks if there is a SubtitleController and displays this message if it does not exist, regardless of whether the source is 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 warning is using Reflection to access the hidden method setSubtitleAnchor class MediaPlayer.

In my case, I’d rather not have to do that, and since that message is just one information and not an exception/alert (as Logcat says), I will simply ignore the message forever.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.