diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-02-01 21:43:56 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-02-01 21:43:56 +0100 |
commit | 976e834a34e2c1641545f60a592f2ca2bed56509 (patch) | |
tree | d75b54242c3cb534397692c697794e60060d1c4a | |
parent | 156421bc9b4bf8652edaddacf4a5eb7d95bc7a3e (diff) |
feat(frontend): clean up audio player mount events
-rw-r--r-- | src/frontend/tubo/components/audio_player.cljs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend/tubo/components/audio_player.cljs b/src/frontend/tubo/components/audio_player.cljs index b8a0e57..40f05b1 100644 --- a/src/frontend/tubo/components/audio_player.cljs +++ b/src/frontend/tubo/components/audio_player.cljs @@ -18,9 +18,10 @@ {:display-name "AudioPlayer" :component-did-mount (fn [this] + (set! (.-onended (rdom/dom-node this)) + #(rf/dispatch [::events/change-media-queue-pos (+ media-queue-pos 1)])) (when stream - (set! (.-src (rdom/dom-node this)) stream) - (set! (.-onended @!player) #(rf/dispatch [::events/change-media-queue-pos (+ media-queue-pos 1)])))) + (set! (.-src (rdom/dom-node this)) stream))) :reagent-render (fn [!player] (let [!elapsed-time @(rf/subscribe [:elapsed-time]) |