I use Logitech media server (LMS) to play my music on a DLNA device. The server also has a youtube plugin and can play the sound of youtube videos if a specific url, which contains the youtube video id, is opened. For example http://myLMS:9000/status.html?p0=playlist&p1=play&p2=youtube://wS1drVzZPmw&player=myPlayer
.
But it only plays back a single video this way. And I'd like them to autoplay, the way they do when youtube is accessed with a browser.
One way to do this, would be to open a browser and read the youtube url every time it changes, somehow, extract the video id from the url, and then forward it to LMS by generating a link, similar to the one I posted above, but containing the id of the video, that was extracted from the youtube url.
The generating and opening of the custom link for the LMS should not be too difficult, by using tasker, I think. But I suspect getting the url from the browser and constantly checking if it changed, would be more difficult.
So - is it possible to read the URL of currently open tab in a browser, every time it changes, and store it as text somewhere?
Or maybe the youtube app on android stores the id of the video it is currently playing somewhere. That might work also, if we could read it somehow. I think the youtube app also autoplays the videos.