                      :seek handle-seek
                      :rewind handle-rewind
                      :fast-forward handle-fast-forward
+                     :finished handle-finished
                      :frames-response handle-frames-response
                      :update-state handle-update-state})
 

  (let [position (new-position (:current-time state) (:duration state) 5)]
    (handle-seek state dispatch [position])))

(defn handle-frames-response [state dispatch [frames-json]]
  (dispatch [:toggle-play])
  (assoc state :loading false

                         (do
                           (dispatch [:update-state apply-changes v])
                           (recur))
                         (dispatch [:finished]))
          stop-playback-chan nil))) ; do nothing, break the loop
    (go
      (<! stop-playback-chan)
