4

I've searched this place and couldn't find any answers for what I'm looking for. I'm trying to use a service to get the title of the currently playing video when the user is using the youtube app. I'm not trying to make an app for playing youtube videos, just to make that clear. Apparently, I can get the title from the URL, but then the question is how do I get the video URL from the currently playing vid? Youtube doesn't seem to send out any intents that could notify me. I know it can be done since the musixmatch app automatically displays floating lyrics when you play a song video in the youtube app.

Abhijith Konnayil
  • 4,067
  • 6
  • 23
  • 49

1 Answers1

1

Using MediaSessionManager, you could call getActiveSessions(ComponentName notificationListener). This will give the list of MediaController. From that you can get the metadata.

Hope this helps.

Sanjeev
  • 11
  • 1