aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/tau/views/stream.cljs
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2023-01-05 15:08:09 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2023-01-05 15:08:09 +0100
commit67007e8bddb6aea4b511d5eb05ed931d352d5467 (patch)
treee6abed6a0666516e7fc3948f909837ae07c7526c /src/frontend/tau/views/stream.cljs
parent6a7d3eac96e55171975693d532c28549012a1319 (diff)
feat(frontend): Introduce video.js for stream playback
Diffstat (limited to 'src/frontend/tau/views/stream.cljs')
-rw-r--r--src/frontend/tau/views/stream.cljs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/frontend/tau/views/stream.cljs b/src/frontend/tau/views/stream.cljs
index 78a1b1e..3363d6a 100644
--- a/src/frontend/tau/views/stream.cljs
+++ b/src/frontend/tau/views/stream.cljs
@@ -7,6 +7,7 @@
[tau.components.loading :as loading]
[tau.components.navigation :as navigation]
[tau.components.comments :as comments]
+ [tau.components.player :as player]
[tau.util :as util]))
(defn stream
@@ -27,11 +28,13 @@
[:div.w-full.pb-4.relative {:class "ml:w-4/5 xl:w-3/5"}
[navigation/back-button service-color]
[:div.flex.justify-center.relative
- {:style {:background (str "center / cover no-repeat url('" thumbnail-url"')")}
- :class "ml:h-[450px] lg:h-[600px]"}
- [:video.bottom-0.object-cover.min-h-full.max-h-full.min-w-full
- {:src content :controls true}
- "This browser can't play the stream format."]]
+ {:class "ml:h-[450px] lg:h-[600px]"}
+ (when stream-format
+ [player/stream-player {"sources" [{"src" content "type" "video/mp4"}
+ {"src" content "type" "video/webm"}]
+ "poster" thumbnail-url
+ "controls" true}
+ content])]
[:div.px-4.ml:p-0
[:div.flex.flex.w-full.mt-3
(when stream-format