forked from Kieran/zap.stream
Show only recent streams
This commit is contained in:
parent
64ddb87cc3
commit
15ac0cacb3
@ -13,6 +13,7 @@ export function LiveVideoPlayer(props: HTMLProps<HTMLVideoElement> & { stream?:
|
||||
|
||||
useEffect(() => {
|
||||
if (streamCached && video.current && !video.current.src && Hls.isSupported()) {
|
||||
try {
|
||||
const hls = new Hls();
|
||||
hls.loadSource(streamCached);
|
||||
hls.attachMedia(video.current);
|
||||
@ -29,6 +30,10 @@ export function LiveVideoPlayer(props: HTMLProps<HTMLVideoElement> & { stream?:
|
||||
setStatus(VideoStatus.Online);
|
||||
})
|
||||
return () => hls.destroy();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
setStatus(VideoStatus.Offline);
|
||||
}
|
||||
}
|
||||
}, [video, streamCached]);
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
import "./root.css";
|
||||
|
||||
import { useMemo } from "react";
|
||||
import { unixNow } from "@snort/shared";
|
||||
import { EventKind, ParameterizedReplaceableNoteStore, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
import { System } from "..";
|
||||
@ -10,7 +11,8 @@ import { findTag } from "utils";
|
||||
export function RootPage() {
|
||||
const rb = new RequestBuilder("root");
|
||||
rb.withFilter()
|
||||
.kinds([30_311 as EventKind]);
|
||||
.kinds([30_311 as EventKind])
|
||||
.since(unixNow() - 86400);
|
||||
|
||||
const feed = useRequestBuilder<ParameterizedReplaceableNoteStore>(System, ParameterizedReplaceableNoteStore, rb);
|
||||
const feedSorted = useMemo(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user