Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should have subtitle controller already set Mediaplayer error #30

Open
ghost opened this issue Jun 18, 2014 · 1 comment
Open

Should have subtitle controller already set Mediaplayer error #30

ghost opened this issue Jun 18, 2014 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 18, 2014

I encountered this bug after using PlayerHater for a while:
http://stackoverflow.com/questions/21790824/mediaplayer-should-have-subtitle-controller-already-set-kitkat

The symptoms are that no music is playing, but if you turn the volume up or down and then play again it works. The fix is inserting mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
after initiating the mediaplayer. This is done in the constructor of StatelyPlayer, so the working code looks like this:

public StatelyPlayer(Context context) {
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
setWakeLock(context);
.......
.......

@cqr
Copy link
Owner

cqr commented Sep 30, 2015

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant