[TIMOB-16134] Android: MediaPlayer on KitKat displays console error about subtitle controller
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-21T00:24:11.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | Release 3.4.0 |
Components | Android |
Labels | module_media, qe-manualtest |
Reporter | Rainer Schleevoigt |
Assignee | Sunila |
Created | 2013-12-24T16:13:27.000+0000 |
Updated | 2015-05-07T19:20:01.000+0000 |
Description
Normal using of mediaplayer generated an error on console:
[ERROR] : MediaPlayer: Should have subtitle controller already set
Hint: http://stackoverflow.com/questions/20166186/android-mediaplayer-warning-should-have-subtitle-controller-already-set
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2014-01-06 at 11.02.09 AM.png | 2014-01-07T06:01:21.000+0000 | 73003 |
We would be happy to look at this issue if you can provide a simple test case to reproduce this issue.
Moving this ticket to engineering as I can reproduce this issue on Android KitKat device. Running above test case prints an error on the Studio console but the test works fine. Please see the attached screenshot for reference.
This error is not always innocuous. Intermittently it will crash the app. I can't see what specific conditions are needed for this error to crash the app, but see the error in the crash logs on Google Play. [ERROR] : MediaPlayer: Should have subtitle controller already set [WARN] : dalvikvm: threadid=35: thread exiting with uncaught exception (group=0x41753ba8) [ERROR] : TiApplication: (Timer-23) [67747,68173] Sending event: exception on thread: Timer-23 msg:java.lang.IllegalStateException; Titanium 3.2.0,2013/12/20 10:57,d9182d6 [ERROR] : TiApplication: java.lang.IllegalStateException [ERROR] : TiApplication: at android.media.MediaPlayer.isPlaying(Native Method) [ERROR] : TiApplication: at ti.modules.titanium.media.TiSound$2.run(TiSound.java:516) [ERROR] : TiApplication: at java.util.Timer$TimerImpl.run(Timer.java:284) [ERROR] : MediaPlayer: Should have subtitle controller already set
Hey i m having the same error please anybody help.............
TC-4236 has a very detailed description and workaround for this issue.
Given the existence of a workaround, moving this into 3.3.1.
https://github.com/appcelerator/titanium_mobile/pull/5855 Looking at the Android source for mediaplayer, the error message about "subtitle controller" is just a information message saying that the subtitle controller is not set and doesn't cause any problem. The real issue is correctly described in TC-4236. If the timer event get executed during media player is releasing, calling isPlaying will throw IllegalStateException as described in the Android documentation. The changes are Just like in other places, handle the exception while calling isPlaying. Stop the progress timer in 'onDestroy' and 'release' before media player is released.
The error itself is innocuous. But the associated PR addresses the crash reported in TC-4236.
Verified the fix. The PR above only fixes the crash case & we still see the error. But, the error is innocuous. Closing. Environment: Appc Studio : 3.4.0.201408180158 Ti SDK : 3.4.0.v20140819094113 Mac OSX : 10.8.5 Alloy : 1.5.0-dev CLI - 3.4.0-dev Code Processor: 1.1.1 Nexus 5 - android 4.4.4
Now I see the error twice each time I play a local video file. With remote file, the error shows only once. I wonder why the error shows twice with local files? I tested it on Android 5.0 and SDK 3.5.1.