aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/tubo/bg_player/events.cljs5
-rw-r--r--src/frontend/tubo/bg_player/views.cljs6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/frontend/tubo/bg_player/events.cljs b/src/frontend/tubo/bg_player/events.cljs
index c82b50e..39b12d9 100644
--- a/src/frontend/tubo/bg_player/events.cljs
+++ b/src/frontend/tubo/bg_player/events.cljs
@@ -6,9 +6,8 @@
(rf/reg-event-fx
:bg-player/seek
[(rf/inject-cofx ::inject/sub [:bg-player])]
- (fn [{:keys [db bg-player]} [_ time]]
- (when (:bg-player/ready db)
- {:player/time {:time time :player bg-player}})))
+ (fn [{:keys [bg-player]} [_ time]]
+ {:player/time {:time time :player bg-player}}))
(rf/reg-event-db
:bg-player/set-paused
diff --git a/src/frontend/tubo/bg_player/views.cljs b/src/frontend/tubo/bg_player/views.cljs
index d554ce3..a7e511b 100644
--- a/src/frontend/tubo/bg_player/views.cljs
+++ b/src/frontend/tubo/bg_player/views.cljs
@@ -271,12 +271,16 @@
#(rf/dispatch [:queue/change-pos (inc queue-pos)]))
(when stream
(set! (.-src (rdom/dom-node this))
- (:content (nth (:audio-streams stream) 0)))))
+ (-> stream
+ :audio-streams
+ first
+ :content))))
:reagent-render
(fn [!player]
[:audio
{:ref #(reset! !player %)
:loop (= @(rf/subscribe [:player/loop]) :stream)
+ :muted @(rf/subscribe [:player/muted])
:on-can-play #(rf/dispatch [:bg-player/ready true])
:on-seeked #(reset! !elapsed-time (.-currentTime @!player))
:on-time-update #(reset! !elapsed-time (.-currentTime @!player))