Live video on the AT Protocol
1import { useMemo } from "react";
2import { StreamplaceAgent } from "streamplace";
3import { useStreamplaceStore } from ".";
4
5export function usePDSAgent(): StreamplaceAgent | null {
6 const oauthSession = useStreamplaceStore((state) => state.oauthSession);
7
8 return useMemo(() => {
9 if (!oauthSession) {
10 return null;
11 }
12
13 return new StreamplaceAgent(oauthSession);
14 }, [oauthSession]);
15}