Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android MediaPlayer warning: Should have subtitle controller already set

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.

like image 775
PFort Avatar asked Nov 23 '13 18:11

PFort


2 Answers

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?

like image 70
Ganesh Avatar answered Oct 20 '22 07:10

Ganesh


mp.reset();
mp.release();

That should help you get rid of the second warning

like image 5
Azad Avatar answered Oct 20 '22 07:10

Azad