Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RemoteControlClient - is Audio Focus necessary/required?

I'm a newbie with RemoteControlClient and I'm still looking into it. However, I've seen that it can be used to get media buttons like Play/Pause on the lock screen.

Anyway, my question is, is Audio Focus required for RemoteControlClient to work to show up on the lock screen? I don't have any form of Audio Focus for my app (and maybe the way my media player is implemented for my app is probably not the best way to do so), and my lock screen controls aren't showing up.

As a side note, I'm also finding the RandomMusicPlayer example to be a little confusing.

like image 407
LOL. NO. Avatar asked Oct 21 '22 15:10

LOL. NO.


1 Answers

Yes, I found out that audio focus is required to have audio controls displayed on lock screen. I implemented it according to RandomMusicPlayer and it works fine now. And yes I agree RandomMusicPlayer is a bit confusing sample. Requires reasonable time to figure it out. Here's a nice tutorial about audio focus you can use too http://developer.android.com/training/managing-audio/audio-focus.html.

like image 188
Fedor Avatar answered Oct 24 '22 12:10

Fedor