Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
baskeboler committed Oct 26, 2023
1 parent 669b3e4 commit fd5d616
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions src/main/cljs_karaoke/audio.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,35 @@

(defn setup-audio-listeners [audio]
(let [out-chan (chan)]
(.. audio
(addEventListener
"canplay"
(fn [evt] (go (>! out-chan (canplay evt))))))
(.. audio
(addEventListener
"canplaythrough"
(fn [evt] (go (>! out-chan (canplaythrough evt))))))
(.. audio
(addEventListener
"ended"
(fn [evt] (go (>! out-chan (ended evt))))))
(.. audio
(addEventListener
"play"
(fn [evt] (go (>! out-chan (play evt))))))
(.. audio
(addEventListener
"pause"
(fn [evt] (go (>! out-chan (pause evt))))))
(.. audio
(addEventListener
"timeupdate"
(fn [evt] (go (>! out-chan (timeupdate evt))))))
(.. audio
(addEventListener
"playing"
(fn [evt] (go (>! out-chan (playing evt))))))
(when audio
(.. audio
(addEventListener
"canplay"
(fn [evt] (go (>! out-chan (canplay evt))))))
(.. audio
(addEventListener
"canplaythrough"
(fn [evt] (go (>! out-chan (canplaythrough evt))))))
(.. audio
(addEventListener
"ended"
(fn [evt] (go (>! out-chan (ended evt))))))
(.. audio
(addEventListener
"play"
(fn [evt] (go (>! out-chan (play evt))))))
(.. audio
(addEventListener
"pause"
(fn [evt] (go (>! out-chan (pause evt))))))
(.. audio
(addEventListener
"timeupdate"
(fn [evt] (go (>! out-chan (timeupdate evt))))))
(.. audio
(addEventListener
"playing"
(fn [evt] (go (>! out-chan (playing evt)))))))
out-chan))


Expand Down

0 comments on commit fd5d616

Please sign in to comment.