diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-20 00:49:47 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-20 00:55:16 +0100 |
commit | f2f9ab53c28a0fe63dfbbc09780ad4c0e9c40ba0 (patch) | |
tree | d32cbc72534f04d1652bac301d71b566eb824047 /src/frontend/tau/views/stream.cljs | |
parent | 49ed8afbdddac61815807cbb8a811ecbd41cd973 (diff) |
feat: Add initial frontend views
Diffstat (limited to 'src/frontend/tau/views/stream.cljs')
-rw-r--r-- | src/frontend/tau/views/stream.cljs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/frontend/tau/views/stream.cljs b/src/frontend/tau/views/stream.cljs new file mode 100644 index 0000000..ccc53eb --- /dev/null +++ b/src/frontend/tau/views/stream.cljs @@ -0,0 +1,27 @@ +(ns tau.views.stream + (:require + [re-frame.core :as rf])) + +(defn stream + [m] + (let [current-stream @(rf/subscribe [:stream]) + stream-type (-> (if (empty? (:video-streams current-stream)) + (:audio-streams current-stream) + (:video-streams current-stream)) + last + :content)] + [:div.flex.flex-col.justify-center.p-5.items-center + [:div.flex.justify-center.py-2 + [:div.flex.justify-center {:class "w-4/5"} + [:video.min-w-full.h-auto {:src stream-type :controls true}]]] + [:div.flex.text-white + [:button.border.rounded.border-slate-900.p-2.bg-slate-800 + {:on-click #(rf/dispatch [:switch-to-global-player current-stream])} + "Add to global stream"] + [:a {:href (:url current-stream)} + "Open original source"]] + [:div.flex.flex-col.items-center.py-2 {:class "w-4/5"} + [:div.min-w-full.py-2 + [:h1.text-xl.font-extrabold (:name current-stream)]] + [:div.min-w-full.py-2 + [:p (:description current-stream)]]]])) |