aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/frontend/tubo/components/audio_player.cljs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/frontend/tubo/components/audio_player.cljs b/src/frontend/tubo/components/audio_player.cljs
index 73cabea..b8a0e57 100644
--- a/src/frontend/tubo/components/audio_player.cljs
+++ b/src/frontend/tubo/components/audio_player.cljs
@@ -19,7 +19,8 @@
:component-did-mount
(fn [this]
(when stream
- (set! (.-src (rdom/dom-node this)) stream)))
+ (set! (.-src (rdom/dom-node this)) stream)
+ (set! (.-onended @!player) #(rf/dispatch [::events/change-media-queue-pos (+ media-queue-pos 1)]))))
:reagent-render
(fn [!player]
(let [!elapsed-time @(rf/subscribe [:elapsed-time])
@@ -32,7 +33,6 @@
:loop (= loop-playback :stream)
:muted muted?
:on-loaded-data #(rf/dispatch [::events/player-start])
- :on-ended #(rf/dispatch [::events/change-media-queue-pos (+ media-queue-pos 1)])
:on-time-update #(reset! !elapsed-time (.-currentTime @!player))
:on-pause #(rf/dispatch [::events/change-player-paused true])
:on-play #(rf/dispatch [::events/change-player-paused false])}]))})))