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.
Asked
Active
Viewed 889 times
4
-
did you figure it out? – Dan Sep 25 '17 at 19:19
-
regarding the title and channel name of the video,b you can get them from the logcat, since they are being logged (how to read logcat programmatically: https://stackoverflow.com/questions/12692103/read-logcat-programmatically-within-application) – ThunderWiring Apr 26 '18 at 13:11
-
have you got any solution ? – mob_web_dev Jun 27 '18 at 13:17
1 Answers
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