Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16134] Android: MediaPlayer on KitKat displays console error about subtitle controller

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-21T00:24:11.000+0000
Affected Version/sRelease 3.2.0
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labelsmodule_media, qe-manualtest
ReporterRainer Schleevoigt
AssigneeSunila
Created2013-12-24T16:13:27.000+0000
Updated2015-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

FileDateSize
Screen Shot 2014-01-06 at 11.02.09 AM.png2014-01-07T06:01:21.000+000073003

Comments

  1. Ritu Agrawal 2013-12-26

    We would be happy to look at this issue if you can provide a simple test case to reproduce this issue.
  2. Ritu Agrawal 2014-01-07

    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.
  3. Matt Moskal 2014-02-23

    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
  4. ajinkya sadanand badve 2014-03-01

    Hey i m having the same error please anybody help.............
  5. Ritu Agrawal 2014-06-09

    TC-4236 has a very detailed description and workaround for this issue.
  6. Ingo Muschenetz 2014-06-20

    Given the existence of a workaround, moving this into 3.3.1.
  7. Sunila 2014-06-26

    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.
  8. Vishal Duggal 2014-07-23

    The error itself is innocuous. But the associated PR addresses the crash reported in TC-4236.
  9. Lokesh Choudhary 2014-08-21

    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
  10. Shawn Lan 2015-05-07

    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.

JSON Source