refactor: refresh
This commit is contained in:
24
src/element/live-event.tsx
Normal file
24
src/element/live-event.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { StreamState } from "@/const";
|
||||
import { extractStreamInfo } from "@/utils";
|
||||
import { TaggedNostrEvent } from "@snort/system";
|
||||
import { Suspense } from "react";
|
||||
import LiveVideoPlayer from "./live-video-player";
|
||||
|
||||
export default function LiveEvent({ ev }: { ev: TaggedNostrEvent }) {
|
||||
const {
|
||||
title,
|
||||
image,
|
||||
status,
|
||||
stream,
|
||||
recording,
|
||||
} = extractStreamInfo(ev);
|
||||
|
||||
return <Suspense>
|
||||
<LiveVideoPlayer
|
||||
title={title}
|
||||
stream={status === StreamState.Live ? stream : recording}
|
||||
poster={image}
|
||||
status={status}
|
||||
/>
|
||||
</Suspense>
|
||||
}
|
Reference in New Issue
Block a user