 
     player = getPlayerObjects()
     player.jquery.attr("controls", "controls")
+    player.jquery.bind "ended", playRandomSong
 
     $.getJSON "/files", (data) =>
         songData = []


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

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

    player.player.load()

            songData.push([key])
            SONGS.push(key)

        if document.location.hash.length > 1
                songName = document.location.hash.substr(1)
                playSong songName
        else
                preloadSong playRandomSong

        columns = [ { "sTitle": "Song" } ]

