RompR icon indicating copy to clipboard operation
RompR copied to clipboard

Enhancement for now playing: Direct link to playlist

Open reconditefinite opened this issue 1 year ago • 1 comments

Enhancement for now playing:

There are times when I would like to stream audio directly to my laptop or phone instead of using the default mpd output device. I would like to have a link at the top right of the now playing module that would provide a dynamically generated playlist containing mp3 urls that would be compatible with any streaming media player like vlc. So the first step would be a new php script named getPlaylist that accepted an id for each playlist. It would generate the playlist contents to point to each mp3 file as a url that could be accessed from any LAN device. This would also require a new script like getFile.php that accepted an id or file name and returned the raw binary contents of the file. The link displayed in the now playing module would reflect the playlist currently in use.

It would be useful to have a new checkbox in the settings labeled "use custom protocol for playlists." Then underneath that checkbox there would be a text box where users could enter any protocol to be added to the playlist url. For example, instead of http://whatever/playlist it could be vlc://whatever/playlist. The vlc protocol handler would then open the playlist in vlc. See the link below for info on setting up a new protocol handler in Linux.

https://medium.com/swlh/custom-protocol-handling-how-to-8ac41ff651eb

playlist_screenshot

EDIT: Another option would be to display a small 'export playlist' icon at the top right of the now playing box. Clicking the icon would then open the playlist in a new tab or, if using a custom protocol handler, in the appropriate app.

export_playlist

You can use the code below to see what a link would look like at the right of the now playing box. Just type javascript: into your browser and then paste the following...

$('#nptext').html('<div style="float:right; font-size:11px;"><a href="#" target="_blank">http://' + document.domain + '/rompr/getPlaylist.php?name=' + $('.playlist').attr('name') + '</a></div>'); alert(1);

reconditefinite avatar Apr 12 '23 02:04 reconditefinite

A much better way to do this, if you're using MPD, is to set up a second MPD output that is an httpd stream. You can then connect VLC directly to it.

https://mpd.readthedocs.io/en/latest/plugins.html#output-plugins

fatg3erman avatar Jul 02 '23 07:07 fatg3erman