Android MediaPlayer warning: Should have subtitle controller already set

PFort picture PFort · Nov 23, 2013 · Viewed 34.3k times · Source

My Nexus 4 got upgraded to 4.4 and now whenever MediaPlayer plays a sound, I get the warning:

Should have subtitle controller already set

And also when calling mp.release() I now get the warning

mediaplayer went away with unhandled events

The same app on a Nexus 7 with 4.3 doesn't display these warnings.

Answer

Ganesh picture Ganesh · Nov 24, 2013

In Android 4.4 kitkat, there is a new feature which supports WebVTT for HLS which has introduced some changes in MediaPlayer. (Reference: Kitkat highlights - Closed Captions)

From your description of the error, it looks like the actual player engine is not invoking setSubtitleAnchor as VideoView is doing here. This leads to the error message from another method here which is invoked as part of the prepare state transition before invoking the listener.

P.S: Is your player a custom player or a standard player which comes pre-bundled as part of the Android distribution? Can you share any further logs?