From 221ae195e901200df1fd942493d38ddc06b63cbf Mon Sep 17 00:00:00 2001 From: dwindown Date: Fri, 16 Jan 2026 15:47:43 +0700 Subject: [PATCH] Fix ProductDetail webinar recording detection to support M3U8 and MP4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to MemberAccess.tsx, ProductDetail.tsx was only checking recording_url and ignoring M3U8 and MP4 recordings from Adilo. Added hasRecording() helper that checks all recording types and updated: - renderActionButtons webinar card display - Badges section (Rekaman Tersedia, Segera Hadir, Telah Lewat) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/pages/ProductDetail.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pages/ProductDetail.tsx b/src/pages/ProductDetail.tsx index ea958f4..0be6721 100644 --- a/src/pages/ProductDetail.tsx +++ b/src/pages/ProductDetail.tsx @@ -302,6 +302,12 @@ export default function ProductDetail() { setExpandedLessonChapters(newSet); }; + // Check if product has any recording (YouTube, M3U8, or MP4) + const hasRecording = () => { + if (!product) return false; + return !!(product.recording_url || product.m3u8_url || product.mp4_url); + }; + if (loading) { return (
); } @@ -332,7 +338,7 @@ export default function ProductDetail() { ); case 'webinar': - if (product.recording_url) { + if (hasRecording()) { return (
@@ -528,13 +534,13 @@ export default function ProductDetail() {

{product.title}

{product.type} - {product.type === 'webinar' && product.recording_url && ( + {product.type === 'webinar' && hasRecording() && ( Rekaman Tersedia )} - {product.type === 'webinar' && !product.recording_url && product.event_start && new Date(product.event_start) > new Date() && ( + {product.type === 'webinar' && !hasRecording() && product.event_start && new Date(product.event_start) > new Date() && ( Segera Hadir )} - {product.type === 'webinar' && !product.recording_url && product.event_start && new Date(product.event_start) <= new Date() && ( + {product.type === 'webinar' && !hasRecording() && product.event_start && new Date(product.event_start) <= new Date() && ( Telah Lewat )}