Fix webinar recording detection to support M3U8 and MP4 from Adilo

The issue was that MemberAccess.tsx was only checking recording_url (YouTube)
and not fetching or checking m3u8_url, mp4_url, or video_host fields.

Changes:
- Added m3u8_url, mp4_url, video_host, and event_start to product queries
- Updated UserAccess interface to include these fields
- Changed webinar recording check to support all recording types
- Now properly detects Adilo recordings as available

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-01-16 14:52:14 +07:00
parent 713d881445
commit ca163e13cf

View File

@@ -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 (
<Button onClick={() => navigate(`/webinar/${item.product.slug}`)} className="shadow-sm">
<Video className="w-4 h-4 mr-2" />