                       :tracks []
                       :current-track 0
                       }
-              :want-play true
-              :audio-el {:track-offset 0 :playing false}
+              :want-play false
+              :audio-el {:track-offset 0 :playing false :ready-state nil}
               }
      }))
 

(defn player-el []
  (aget (.getElementsByTagName js/document "audio") 0))

(defn transport-buttons-view [wanted owner]
  (reify
    om/IRender
    (render [this]
      (let [queue (:queue wanted)
            actual (player-el)
            want-play (:playing (:audio-el wanted))
            actually-playing (and actual (not (.-paused actual)))
            command-chan (om/get-shared owner :command-channel)
(defn swallowing [h]
  (fn [e]
    (let [r (h e)]
      (.stopPropagation e)
      r)))

            playing (cond
                      (and actually-playing (not want-play))
                      :pending
                      (and (not actually-playing) want-play)
                      :pending
                      (:playing wanted)
                      true
                      :else false)
            track (queue-current-entry queue)]
        (html
         [:div {:id "transport"
                :onClick #(om/transact! wanted [:viewing-queue?] not)
                }
          [:span {:className "index"}
           [:span {:className "current"} (inc (:current-track queue))]
           "/"

          [:div {:className "queue queue-open tracks" }
           (om/build queue-view (:queue (:player state)))]
          [:div {:className "queue tracks" } " "])
        (om/build transport-strip-view (:player state))
        (om/build audio-el (:audio-el (:player state)))
        ]))))

