               :playing true
               :track-offset 0
               :track-offset-when 0
-              :source nil
               }
      }))
 


(defn tab-on-view []
  (om/ref-cursor (:tab-on-view (om/root-cursor app-state))))

(defn enqueue-track [track]
  (om/transact! (player-queue) #(conj % track)))

      (let [el (om/get-node owner)]
        ;; last arg "true" is cos audio events don't bubble
        ;; http://stackoverflow.com/questions/11291651/why-dont-audio-and-video-events-bubble
        (.addEventListener el "ended" player-next true)))
    om/IRender
    (render [this]
      (let [queue (om/observe owner (player-queue))
            on-view (om/observe owner (tab-on-view))]
        (dom/span #js {}
                  (dom/button #js { :onClick player-pause }
                              ">")
                  (dom/button #js { :onClick player-next }
                              ">>|")
                  (dom/button #js { :onClick player-prev }
                              "|<<")
                  (dom/audio #js {:ref "player"}))))))


(defn update-term [[command new-terms] previous]
