start video streaming

This commit is contained in:
Chris Kruining 2025-04-02 22:57:45 +02:00
parent 4b51fbc908
commit 445fde7b6b
Signed by: chris
SSH key fingerprint: SHA256:nG82MUfuVdRVyCKKWqhY+pCrbz9nbX6uzUns4RKa1Pg
15 changed files with 448 additions and 225 deletions

View file

@ -10,7 +10,7 @@ export const ListItem: Component<{ entry: Entry }> = (props) => {
<main>
<strong>{props.entry.title}</strong>
<a href={`/content/${props.entry.id}`}>Watch now</a>
<a href={`/watch/${props.entry.id}`}>Watch now</a>
</main>
</div>
);

View file

@ -1,4 +1,10 @@
import { Component, createEffect, createSignal, Index, onMount } from "solid-js";
import {
Component,
createEffect,
createSignal,
Index,
onMount,
} from "solid-js";
import type { Entry, Category } from "../content";
import { ListItem } from "./list-item";
import { List } from "~/components/list";
@ -15,7 +21,11 @@ export const Overview: Component<OverviewProps> = (props) => {
onMount(() => {
new MutationObserver(() => {
container()?.querySelector(`.${css.list} > ul > div:nth-child(4) > main > a`)?.focus({ preventScroll: true });
container()
?.querySelector<HTMLElement>(
`.${css.list} > ul > div:nth-child(4) > main > a`,
)
?.focus({ preventScroll: true });
}).observe(document.body, { subtree: true, childList: true });
});
@ -25,11 +35,15 @@ export const Overview: Component<OverviewProps> = (props) => {
<Index each={props.categories}>
{(category) => (
<List class={css.list} label={category().label} items={category().entries}>
<List
class={css.list}
label={category().label}
items={category().entries}
>
{(entry) => <ListItem entry={entry()} />}
</List>
)}
</Index>
</div>
);
}
};