                   (do
                     (om/set-state! owner :current-position c)
                     (om/set-state! owner :end-position e))))
-              (recur)))
-        ))
+              (recur))))
     om/IRender
     (render [this]
       (let [ctrl-current (om/get-state owner :ctrl)

                    track-src (om/get-state owner :current-src)
                    next-track (last (take next-offset track-src))
                    previous-track (last (take previous-offset track-src))
                    ]
                (om/set-state! owner :ctrl ctrl)
                (cond
                  (and (= ctrl :next) (> next-offset (count track-src)))
                  (ctrl-audio-node :stop)
                  (and (= ctrl :next) (not (nil? next-track)))
                  (set-track next-track next-offset)
                  (and (= ctrl :previous) (not (nil? previous-track)))
                  (set-track previous-track previous-offset)
                  :else (ctrl-audio-node ctrl)))
              (recur)))
        (go (loop []
              (<! channels/stream-position)

      :seek-forward (aset audio-node "currentTime" (+ (.-currentTime audio-node) 1))
      (.pause audio-node))))

(defn set-track [track offset owner]
  (om/set-state! owner :current-offset offset)
  (aset audio-node "src" (tracks/mk-track-url track))
  (ctrl-audio-node :play)
  (put! channels/now-playing track))

(defn audio-elem [data owner]
  (reify
    om/IInitState
