feat: Add Cloudflare StreamPlayer component and update schema with billing and access control

- Introduced `CloudflareStreamPlayer` React component for embedding streams
- Updated `package.json` with new dependencies: `@cloudflare/stream-react` and `stripe`
- Extended database schema with user tiers, Stripe billing, storage, and archive management
- Added access control logic in `access.ts` for user tiers and feature permissions
- Enhanced billing logic with archive storage limits and subscription checks
This commit is contained in:
Nikita
2025-12-21 14:56:30 -08:00
parent 8cd4b943a5
commit 103a4ba19c
18 changed files with 1608 additions and 36 deletions

View File

@@ -0,0 +1,37 @@
import { Stream } from "@cloudflare/stream-react"
type CloudflareStreamPlayerProps = {
uid: string
customerCode?: string
autoPlay?: boolean
muted?: boolean
onReady?: () => void
}
export function CloudflareStreamPlayer({
uid,
customerCode,
autoPlay = true,
muted = false,
onReady,
}: CloudflareStreamPlayerProps) {
const handleReady = () => {
onReady?.()
}
return (
<Stream
className="h-full w-full"
src={uid}
customerCode={customerCode}
controls
autoplay={autoPlay}
muted={muted}
responsive={false}
height="100%"
width="100%"
onCanPlay={handleReady}
onPlaying={handleReady}
/>
)
}