I tried to browse the web to see what MediaSessionManager does and used for and reading RemoteController (the deprecated since API 21) so I can see whether these api can solve my problem.
At the moment, I am using AudioManger and send the key event to stop / pause / play of the current audio from other music player... It does do the job. Now I am wondering whether it can be done for media player e.g YouTube app which playing a video and my app from other device can act like a remote to control the video playback on the second device.
I ended up reading MediaSessionManager. It give all active media session with the currently playing music players. I am not sure is it the right solution to solve my scenario above. Since I am working on Android 4.4.2, I think MediaSessionManager probably not the right way so I found something called RemoteController but unsure how it really work and whether it help solving my problem
There is too many thing here, I don't know where to start.