How do you use MediaControllerCompat to control th

2019-04-23 14:59发布

问题:

My app is not the media player. I just want to be able to control the current media player using the new MediaControllerCompat class. Currently I am using MediaSessionManager but want to upgrade to the new compat classes.

How do I instantiate the MediaControllerCompat class when I don't have a token or MediaSessionCompat to instantiate it with? I am hoping to get some example code.

回答1:

I asked Ian Lake, the Google dev who did the video on MediaSessionCompat, who said it is not possible (https://www.youtube.com/watch?v=FBC1FgWe5X4). We still have to use MediaSessionManager.