 
 videojs('video_player').ready ->
     @.on 'loadedmetadata', ->
-        $('#PlayerContainer .duration').text(moment(@duration()*1000).format('m:ss'))
+        playerContainer.find('.duration').text(moment(@duration()*1000).format('m:ss'))
         videojs('video_player').play()
 
     @.on 'timeupdate', ->
-        $('#PlayerContainer .progress-current').css({'width': (this.currentTime() / this.duration()) * 100 + '%'})
-        $('#PlayerContainer .current-time').text(moment(this.currentTime()*1000).format('m:ss'))
+        playerContainer.find('.progress-current').css({'width': (this.currentTime() / this.duration()) * 100 + '%'})
+        playerContainer.find('.current-time').text(moment(this.currentTime()*1000).format('m:ss'))
 
     @.on 'ended', ->
-        if $('#PlayerContainer .repeat').closest(".action").hasClass("active")
+        if playerContainer.find('.repeat').closest(".action").hasClass("active")
           videojs('video_player').currentTime(0)
           videojs('video_player').play()
-        else if $('#PlayerContainer .random').closest(".action").hasClass("active")
+        else if playerContainer.find('.random').closest(".action").hasClass("active")
           t = __playerTracklist[Math.floor(Math.random() * __playerTracklist.length)]
           PlayTrack(t.artist, t.title, t.cover_url_medium, t.cover_url_large)
         else

request = require('request')
ytdl = require('ytdl')

itag_priorities = [ # http://en.wikipedia.org/wiki/YouTube > Comparison of YouTube media encoding options
    85,

    if e.keyCode is 39 and e.target.tagName != 'INPUT'
        PlayNext(__currentTrack.artist, __currentTrack.title)

playerContainer.find('.info .track-info .action .play, .info .track-info .action .pause').click ->
    if $(@).hasClass('play')
        videojs('video_player').play()
    else
