flash music player?
Yep I've been seriously hacking one. It may sound silly but I can't actually think of a straightforward way to point something at a directory like that. You sometimes see directory listings while browsing but they are pages generated by the server, there's no standard format to them. With the player I'm messing with, you can either point it to a single MP3 or you can point it to an XML file listing each of the files. The syntax for the XML isn't hard.
The image files are optional. You can also link to a page for each track but that's optional too. The player comes from http://musicplayer.sourceforge.net but I've practically rewritten half of it. My changes have been sent to the author but he hasn't had time to put out a new release yet. If you want a copy of my version then let me know.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<trackList>
<track>
<location>http://www.foobar.com/song1.mp3</location>
<creator>Chewi</creator>
<title>Darkened Soul</title>
<image>http://www.foorbar.com/song1.jpg</image>
</track>
<track>
<location>http://www.foobar.com/song2.mp3</location>
<creator>Kaos</creator>
<title>Foolz Gold</title>
<image>http://www.foobar.com/song2.jpg</image>
</track>
</trackList>
</playlist>
Last edited by Chewi on Wed Feb 14, 2007 11:04 am, edited 1 time in total.
Picachewi, I choose you!
(besides, I if run into a problem I know who to bother about it)
(besides, I if run into a problem I know who to bother about it)
Last edited by kaos on Wed Feb 14, 2007 3:21 pm, edited 1 time in total.
Okay sorry this took so long. I've been busy and was still hacking at it.
Here's my demo page. The tracks might break up because the upload bandwidth isn't great. View the source to see how to do the HTML.
http://www.aura-online.co.uk/~chewi/mp3/index.html
Here's the SWF file. There's also a slim version.
http://www.aura-online.co.uk/~chewi/mp3/xspf_player.swf
http://www.aura-online.co.uk/~chewi/mp3/xspf_player_slim.swf
And here's the playlist file I used for the demo.
http://www.aura-online.co.uk/~chewi/mp3/chewi.xspf
If you're wondering about the HTML missing the embed tag that you find in most HTML used for Flash, it actually isn't required. object is the standard tag but Internet Explorer fucked with it to the point where other browsers weren't actually able to make proper sense of it. The embed tag is usually provided for those other browsers. For some content though, you can get away with just using object. It works for Flash as long as you don't mind IE downloading the whole SWF before playing it. In this case, the player is only 60KB and it won't work until it's finished downloading anyway.
While I'm on the subject, you may find this hard to believe but apparently the img tag will not form part of XHTML 2.0. object should be used for images instead.
Here's my demo page. The tracks might break up because the upload bandwidth isn't great. View the source to see how to do the HTML.
http://www.aura-online.co.uk/~chewi/mp3/index.html
Here's the SWF file. There's also a slim version.
http://www.aura-online.co.uk/~chewi/mp3/xspf_player.swf
http://www.aura-online.co.uk/~chewi/mp3/xspf_player_slim.swf
And here's the playlist file I used for the demo.
http://www.aura-online.co.uk/~chewi/mp3/chewi.xspf
If you're wondering about the HTML missing the embed tag that you find in most HTML used for Flash, it actually isn't required. object is the standard tag but Internet Explorer fucked with it to the point where other browsers weren't actually able to make proper sense of it. The embed tag is usually provided for those other browsers. For some content though, you can get away with just using object. It works for Flash as long as you don't mind IE downloading the whole SWF before playing it. In this case, the player is only 60KB and it won't work until it's finished downloading anyway.
While I'm on the subject, you may find this hard to believe but apparently the img tag will not form part of XHTML 2.0. object should be used for images instead.
Last edited by Chewi on Thu Feb 22, 2007 10:34 pm, edited 1 time in total.
just ran into a problem,
but Its probably not to do with the player.
I need deny people direct access to the music directory
but when I drop a "deny from all" in the htaccess thing, the player wont grab the music. it'll just sort of hang.
I'm guessomg the real issue is that I probably need to use somthing else in the ataccess bit. but im amature at this. so I dunno what that is.
but Its probably not to do with the player.
I need deny people direct access to the music directory
but when I drop a "deny from all" in the htaccess thing, the player wont grab the music. it'll just sort of hang.
I'm guessomg the real issue is that I probably need to use somthing else in the ataccess bit. but im amature at this. so I dunno what that is.
Deny from all will stop all downloads, including through the player. Preventing people from "saving" content played through Flash players and the like is a total myth and it really pisses me off when companies claim to offer that kind of protection. Even my experienced sysadmin friend believed it was possible and gave YouTube as an example. Two minutes later, I had a YouTube video saved to my home directory and playing through my regular media player.
If all you want to do is prevent people getting a directory listing of the music directory, you can either pop a blank index.html file in there or you can add "Options -Indexes" to your htaccess file.
To autoplay, just add &autoplay=1 after autoload=1. Easy huh?
If all you want to do is prevent people getting a directory listing of the music directory, you can either pop a blank index.html file in there or you can add "Options -Indexes" to your htaccess file.
To autoplay, just add &autoplay=1 after autoload=1. Easy huh?
Last edited by Chewi on Sun Feb 25, 2007 1:43 pm, edited 1 time in total.
Oops I said "Options -Index" above but I should have said "Options -Indexes". Corrected now. My Apache is a bit rusty.
Last edited by Chewi on Sun Feb 25, 2007 1:44 pm, edited 1 time in total.