0

I would like to add lockscreen controls for my app similar to what netflix or youtube does when casting to a chromecast device.

Do I do this with a lockscreen widget that I add and remove on demand or is there a different method?

Thank you.

casolorz
  • 8,486
  • 19
  • 93
  • 200

1 Answers1

2

The proper way to add a lock screen controller is to use the RemoteControlClient. There are limitations to what you can do there, both in terms of the functionality and availability based on the Android version. If you are running Android version 4.1+, then the required functionality is there (check out the Google Play Music to see how it can look like). Give that a try and if run into issues, come back here and post your issue(s).

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28
  • Thanks for the info. I have noticed Netflix will sometimes show full screen controls and sometimes above the unlock wheels. Is that all done with the RemoteControlClient? – casolorz Jan 29 '14 at 16:06
  • RemoteControlClient implementation has changed between JB and KitKat: in JB, it is a small area and in KitKat it is a full screen background image. Netflix, on the other hand, uses a different mechanism which I would call a "hack"; we encourage folks to stay away from any hacks and just rely on the RCC for lock screen implementations. – Ali Naddaf Jan 29 '14 at 16:16
  • @AliNaddaf How do we show the lockscreen image using the new MediaSessionCompat class? http://stackoverflow.com/questions/38752191/chromecast-sender-v2-7-0-lockscreen-image – user2511882 Aug 03 '16 at 22:34