From c496ca3db96f19f8c37d041021036b447a8a8c4b Mon Sep 17 00:00:00 2001 From: trueChazza Date: Thu, 13 Apr 2023 14:57:47 +1200 Subject: [PATCH] feat: add dynamic player --- .dockerignore | 3 +- assets/tailwind.config.js | 2 +- .../components/layouts/root.html.heex | 2 +- .../controllers/page_controller.ex | 7 + .../controllers/page_html/home.html.heex | 142 ++++++++++++++++-- .../controllers/page_html/index.html.heex | 7 + lib/exstream_web/router.ex | 1 + mix.exs | 2 +- .../controllers/page_controller_test.exs | 2 +- 9 files changed, 152 insertions(+), 16 deletions(-) create mode 100644 lib/exstream_web/controllers/page_html/index.html.heex diff --git a/.dockerignore b/.dockerignore index 30c1abb..6d2eaaa 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1 @@ -.github/ -dev/ \ No newline at end of file +.github/ \ No newline at end of file diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index 1174033..bd10a21 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -14,7 +14,7 @@ module.exports = { theme: { extend: { colors: { - brand: "#FD4F00", + brand: "#ef4444", } }, }, diff --git a/lib/exstream_web/components/layouts/root.html.heex b/lib/exstream_web/components/layouts/root.html.heex index b2745ca..a25f5b3 100644 --- a/lib/exstream_web/components/layouts/root.html.heex +++ b/lib/exstream_web/components/layouts/root.html.heex @@ -4,7 +4,7 @@ - <.live_title suffix=" ยท Phoenix Framework"> + <.live_title> <%= assigns[:page_title] || "Exstream" %> diff --git a/lib/exstream_web/controllers/page_controller.ex b/lib/exstream_web/controllers/page_controller.ex index d35cd71..b630ffc 100644 --- a/lib/exstream_web/controllers/page_controller.ex +++ b/lib/exstream_web/controllers/page_controller.ex @@ -1,6 +1,13 @@ defmodule ExstreamWeb.PageController do use ExstreamWeb, :controller + def index(conn, %{"path" => path, "duration" => duration}) do + render(conn + |> assign(:path, path) + |> assign(:duration, duration), + :index, layout: false) + end + def home(conn, _params) do # The home page is often custom made, # so skip the default app layout. diff --git a/lib/exstream_web/controllers/page_html/home.html.heex b/lib/exstream_web/controllers/page_html/home.html.heex index 63a4d04..4c49dd0 100644 --- a/lib/exstream_web/controllers/page_html/home.html.heex +++ b/lib/exstream_web/controllers/page_html/home.html.heex @@ -1,11 +1,133 @@ - - - +<.flash_group flash={@flash} /> + +
+
+ + + +

+ Exstream + + v1.0.0 + +

+

+ Simple HLS HTTP server. Agnostic and on-demand. +

+

+ Self host and serve your own static media files with fewer moving parts. Coming soon out of the box integration with Midarr server allows you to enjoy your media for fun or at scale. +

+
- \ No newline at end of file + +
diff --git a/lib/exstream_web/controllers/page_html/index.html.heex b/lib/exstream_web/controllers/page_html/index.html.heex new file mode 100644 index 0000000..3119e26 --- /dev/null +++ b/lib/exstream_web/controllers/page_html/index.html.heex @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/lib/exstream_web/router.ex b/lib/exstream_web/router.ex index ea7953e..c651a6d 100644 --- a/lib/exstream_web/router.ex +++ b/lib/exstream_web/router.ex @@ -18,6 +18,7 @@ defmodule ExstreamWeb.Router do pipe_through :browser get "/", PageController, :home + get "/watch", PageController, :index end scope "/api", ExstreamWeb do diff --git a/mix.exs b/mix.exs index 0db696c..3d65bf6 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Exstream.MixProject do def project do [ app: :exstream, - version: "0.1.0", + version: "1.0.0", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, diff --git a/test/exstream_web/controllers/page_controller_test.exs b/test/exstream_web/controllers/page_controller_test.exs index eeccbcb..0e83ead 100644 --- a/test/exstream_web/controllers/page_controller_test.exs +++ b/test/exstream_web/controllers/page_controller_test.exs @@ -3,6 +3,6 @@ defmodule ExstreamWeb.PageControllerTest do test "GET /", %{conn: conn} do conn = get(conn, ~p"/") - assert html_response(conn, 200) =~ "Peace of mind from prototype to production" + assert html_response(conn, 200) =~ "Simple HLS HTTP server. Agnostic and on-demand." end end