             songData.push([key])
             SONGS.push(key)
 
-        player.jquery.bind "ended", playRandomSong
-        preloadSong playRandomSong
+        if document.location.hash.length > 1
+                songName = document.location.hash.substr(1)
+                playSong songName
+        else
+                preloadSong playRandomSong
 
         columns = [ { "sTitle": "Song" } ]
 


    player = getPlayerObjects()
    player.jquery.attr("controls", "controls")

    $.getJSON "/files", (data) =>
        songData = []


playRandomSong = ->
    song = nextSong
    window.location = "#" + song
    $("#status").text(song)
    player = getPlayerObjects()
    player.player.pause()
    player.jquery.empty()

    audioType = PLAYBACK_TYPES[PLAYBACK_TYPE]
    encodedPath = encodeURIComponent(song)
    player.jquery.append("<source src=\"/file/#{encodedPath}?type=#{PLAYBACK_TYPE}\" type='#{audioType}' />")

    player.player.load()
