MediaBrowserServiceCompat vs mediaSessionCompat?

霸气de小男生 提交于 2019-12-03 21:59:59

mediaBrowserCompat and mediaBrowserServiceCompat are used if you have many UI interfaces like Android Auto, Wear, mobile etc so the playback runs in all devices synchronously. mediaBrowserCompat is coded in the Activties where you need to control the service from. So it can be coded multiple times, like one for Main Activity of phone, one for Auto, one for Wear, etc. Whereas, mediaBrowserServiceCompat is coded only once inside the service class for the above mentioned mediaBrowserServiceCompats can connect to it and control the playback using mediaControllerCompat. The connection is set using setSession(token) and accessed by getSession(token).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!