diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 01:01:26 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-30 01:01:26 +0100 |
commit | c3b4e2d87a2031c3499e49f47c39c7119adeb170 (patch) | |
tree | 0c0348410a6fd3afe8a6c5e479e5660c030a0a60 /src/frontend/tau/views | |
parent | 45694468ccea8219c47dfc470e9e5ef885f671bd (diff) |
feat(frontend): Add basic global player
Diffstat (limited to 'src/frontend/tau/views')
-rw-r--r-- | src/frontend/tau/views/player.cljs | 11 | ||||
-rw-r--r-- | src/frontend/tau/views/stream.cljs | 6 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/frontend/tau/views/player.cljs b/src/frontend/tau/views/player.cljs deleted file mode 100644 index 732e542..0000000 --- a/src/frontend/tau/views/player.cljs +++ /dev/null @@ -1,11 +0,0 @@ -(ns tau.views.player - (:require - [re-frame.core :as rf])) - -(defn global-player - [] - (let [global-stream @(rf/subscribe [:global-stream]) - show-global-player? @(rf/subscribe [:show-global-player])] - [:div - [:audio {:src global-stream - :class (when-not show-global-player? "hidden")}]])) diff --git a/src/frontend/tau/views/stream.cljs b/src/frontend/tau/views/stream.cljs index 033b2da..7ef9e85 100644 --- a/src/frontend/tau/views/stream.cljs +++ b/src/frontend/tau/views/stream.cljs @@ -16,7 +16,7 @@ description uploader-avatar uploader-author uploader-url upload-date related-streams thumbnail-url show-comments-loading comments-page - show-comments] :as stream} @(rf/subscribe [:stream]) + show-comments service-id] :as stream} @(rf/subscribe [:stream]) stream-type (-> (if (empty? video-streams) audio-streams video-streams) last :content) @@ -35,7 +35,9 @@ [:div.px-4.md:p-0 [:div.flex.flex.w-full.mt-3.justify-center [:button.border.rounded.border-black.px-3.py-1.bg-stone-800 - {:on-click #(rf/dispatch [::events/switch-to-global-player stream])} + {:on-click #(rf/dispatch [::events/switch-to-global-player + {:uploader-name uploader-author :uploader-url uploader-url + :name name :url url :stream stream-type :service-color service-color}])} [:i.fa-solid.fa-headphones]] [:a {:href url} [:button.border.rounded.border-black.px-3.py-1.bg-stone-800.mx-2 |