(params.region ?? null);
+ const regions = import.meta.env.PUBLIC_RELAY_REGIONS ? import.meta.env.PUBLIC_RELAY_REGIONS.split(",") : [];
+ const host = params.server || import.meta.env.PUBLIC_RELAY_HOST;
+
+ createEffect(() => {
+ const scheme = params.scheme || import.meta.env.PUBLIC_RELAY_SCHEME || "https";
+
+ const r = region();
+ const server = r === null ? host : `${r}.${host}`;
+
+ props.setUrl(`${scheme}://${server}/${props.path}`);
+ });
+
+ return (
+
+
+ Relay:
+
+
+
+ {(r) => (
+
+ )}
+
+
+ );
+}
diff --git a/src/components/watch.tsx b/src/components/watch.tsx
index 5968b6a..b287fe7 100644
--- a/src/components/watch.tsx
+++ b/src/components/watch.tsx
@@ -1,16 +1,16 @@
-import "@kixelated/moq/video";
+import "@kixelated/moq/watch";
-export default function Watch(props: { path: string }) {
- // Use query params to allow overriding environment variables.
- const urlSearchParams = new URLSearchParams(window.location.search);
- const params = Object.fromEntries(urlSearchParams.entries());
- const server = params.server ?? import.meta.env.PUBLIC_RELAY_HOST;
+import { createSignal } from "solid-js";
+
+import Region from "@/components/region";
- const url = `https://${server}/${props.path}`;
+export default function Watch(props: { path: string }) {
+ const [url, setUrl] = createSignal("");
return (
-
-
-
+
+
+
+
);
}
diff --git a/src/layouts/global.css b/src/layouts/global.css
index 7df573f..ce05579 100644
--- a/src/layouts/global.css
+++ b/src/layouts/global.css
@@ -26,7 +26,7 @@
button,
.form-button {
@apply rounded-md border-0 bg-slate-700 font-bold shadow-sm hover:bg-slate-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2;
- @apply px-12 py-4 text-2xl;
+ @apply px-8 py-3 text-lg;
}
input,