Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement for now playing: Direct link to playlist #146

Open
reconditefinite opened this issue Apr 12, 2023 · 1 comment
Open

Enhancement for now playing: Direct link to playlist #146

reconditefinite opened this issue Apr 12, 2023 · 1 comment

Comments

@reconditefinite
Copy link

reconditefinite commented Apr 12, 2023

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);

@fatg3erman
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants