diff --git a/src/pages/member/MemberAccess.tsx b/src/pages/member/MemberAccess.tsx index 539f7c0..f21d0b6 100644 --- a/src/pages/member/MemberAccess.tsx +++ b/src/pages/member/MemberAccess.tsx @@ -23,6 +23,10 @@ interface UserAccess { type: string; meeting_link: string | null; recording_url: string | null; + m3u8_url: string | null; + mp4_url: string | null; + video_host: 'youtube' | 'adilo' | 'unknown' | null; + event_start: string | null; description: string; }; } @@ -55,7 +59,7 @@ export default function MemberAccess() { // Get direct user_access supabase .from('user_access') - .select(`id, granted_at, expires_at, product:products (id, title, slug, type, meeting_link, recording_url, description)`) + .select(`id, granted_at, expires_at, product:products (id, title, slug, type, meeting_link, recording_url, m3u8_url, mp4_url, video_host, event_start, description)`) .eq('user_id', user!.id), // Get products from paid orders (via order_items) supabase @@ -63,7 +67,7 @@ export default function MemberAccess() { .select( ` order_items ( - product:products (id, title, slug, type, meeting_link, recording_url, description) + product:products (id, title, slug, type, meeting_link, recording_url, m3u8_url, mp4_url, video_host, event_start, description) ) `, ) @@ -151,8 +155,11 @@ export default function MemberAccess() { // Check if webinar has ended const webinarEnded = item.product.event_start && new Date(item.product.event_start) <= new Date(); + // Check if any recording exists (YouTube, M3U8, or MP4) + const hasRecording = item.product.recording_url || item.product.m3u8_url || item.product.mp4_url; + // If recording exists, show it - if (item.product.recording_url) { + if (hasRecording) { return (