Page 1 of 1

Create a URL to a song

PostPosted: Fri Jul 10, 2009 6:48 pm
by kapz
Hi Sindre,

I have a need to share a song with someone, but don't necessarily want to create an account and explain where to find the song.

Can I simply embed subsonic's web player on a webpage for one song (stopped of course) or a link which just streams one song? I don't want the user to see the rest of my collection. Could you provide some assistance if this is possible?

Thanks so much

P.S. I can read code.

PostPosted: Sat Jul 11, 2009 8:12 am
by sindre_mehus
It's technically possible, although not very simple.

To get the stream URL of a given song, set your player settings to "External with playlist", then play the song. Go to your external player and find the URL there. (Typically by looking at the properties of the currently playing song).

Now you can use any web-based player to stream that song, for instance http://www.longtailvideo.com/players/jw-flv-player/

Hope this helps :-)

PostPosted: Sat Jul 11, 2009 8:07 pm
by kapz
Thanks for link to the open source video player. The external player URL wasn't working for me, but since I have Apache installed I was able to make my own html page on my server and get it working for my needs. I only want to share a few songs.

Code: Select all
<script type="text/javascript" src="swfobject.js"></script>

<div id="player">This text will be replaced</div>

<script type="text/javascript">
var so = new SWFObject('player.swf','mpl','314','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=Air - All I Need.mp3&image=Air - Moon Safari (F).jpg&stretching=exactfit');
so.write('player');
</script>


The URL I was using for &file= parameter above did not work for me.

Code: Select all
http://[IP ADDRESS]:22888/subsonic/stream?player=1&pathUtf8Hex=4f3a5c4d555349435f4d4f52455c434420415243484956455c4169725c416972202d204d6f6f6e205361666172695c303320416c6c2049204e6565642e6d7033&suffix=.mp3

PostPosted: Sun Jul 12, 2009 8:58 pm
by nublet
wish that made any sense to me lol