mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
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:
37
packages/web/src/components/CloudflareStreamPlayer.tsx
Normal file
37
packages/web/src/components/CloudflareStreamPlayer.tsx
Normal 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}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user