mp3play
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mp3play [2006/11/13 12:22] – 206.161.205.190 | mp3play [2006/11/13 13:32] (current) – old revision restored andi | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== play .m3u playlists via http ====== | ||
| + | |||
| + | All my mp3s are stored on my filesever. Normally I just mount the mp3 directory on my current workstation (either via NFS or Samba). I have some playlists too which store all files with relative paths (relative to the playlist location). This works fine. | ||
| + | |||
| + | But sometimes I want to have an easy way to listen to a playlist without mounting anything (eg. when using the laptop). So I made the mp3 files and playlists available on my local Apache webserver and use the following short CGI to get a playlist with http adresses to the file. | ||
| + | |||
| + | <code perl> | ||
| + | # | ||
| + | |||
| + | $WEBDIR = '/ | ||
| + | $WEBSERVER = ' | ||
| + | |||
| + | use CGI; | ||
| + | use File:: | ||
| + | |||
| + | print " | ||
| + | |||
| + | $q = new CGI(); | ||
| + | |||
| + | $list = $q-> | ||
| + | $dir = dirname($list); | ||
| + | $list = $WEBDIR.'/' | ||
| + | |||
| + | open (LIST, $list) or die(" | ||
| + | @m3u = < | ||
| + | close LIST; | ||
| + | |||
| + | foreach $file (@m3u){ | ||
| + | $file = ' | ||
| + | | ||
| + | print " | ||
| + | } | ||
| + | </ | ||
mp3play.txt · Last modified: by andi
