 
 class Video extends Node
 
+  selectVideo = -> document.querySelector('#player video')
+
   constructor: (@id)->
-    @waitForVideoNode().then => super @node
+    super()
+    @waitForVideoNode().then (node)=> @node = node
 
   pause: ->
     @node.pause()

  waitForVideoNode: ->
    new Promise (resolve)=>
      setInterval =>
        resolve() if @node = document.querySelector('#player video')
      , POLLING_INTERVAL

class Button extends Node

  constructor: (@video)->
    @styleInterval = null
    button             = document.createElement('button')
    button.title       = 'Pop out'
    button.className   = "#{BUTTON_CLASS} #{HIDDEN_CLASS}"
    super button
    @setClickBehavior()
    @maintainStyle()



class Node

  offset: ->
    el = @node
    left = top = 0
