mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
Add real-time viewer count component and integrate it into stream page; update presence tracking logic with Jazz.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { JazzReactProvider } from "jazz-tools/react"
|
||||
import { ViewerAccount } from "./schema"
|
||||
|
||||
// Jazz Cloud API key - using public demo key for now
|
||||
// TODO: Replace with linsa-specific key from https://jazz.tools
|
||||
const JAZZ_API_KEY = "jazz_cloud_demo"
|
||||
|
||||
interface JazzProviderProps {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
/**
|
||||
* Jazz provider for stream viewer presence tracking
|
||||
* Uses anonymous auth - viewers don't need to sign in
|
||||
*/
|
||||
export function JazzProvider({ children }: JazzProviderProps) {
|
||||
return (
|
||||
<JazzReactProvider
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${JAZZ_API_KEY}`,
|
||||
when: "always",
|
||||
}}
|
||||
AccountSchema={ViewerAccount}
|
||||
>
|
||||
{children}
|
||||
</JazzReactProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user