Add video chapter/timeline navigation feature
Implement timeline chapters for webinar and bootcamp videos with click-to-jump functionality: **Components:** - VideoPlayerWithChapters: Plyr.io-based player with chapter support - TimelineChapters: Clickable chapter markers with active state - ChaptersEditor: Admin UI for managing video chapters **Features:** - YouTube videos: Clickable timestamps that jump to specific time - Embed videos: Static timeline display (non-clickable) - Real-time chapter tracking during playback - Admin-defined accent color for Plyr theme - Auto-hides timeline when no chapters configured **Database:** - Add chapters JSONB column to products table (webinars) - Add chapters JSONB column to bootcamp_lessons table - Create indexes for faster queries **Updated Pages:** - WebinarRecording: Two-column layout (video + timeline) - Bootcamp: Per-lesson chapter support - AdminProducts: Chapter editor for webinars - CurriculumEditor: Chapter editor for lessons 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
17
supabase/migrations/20251231000000_add_video_chapters.sql
Normal file
17
supabase/migrations/20251231000000_add_video_chapters.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Add chapters support to products table (for webinars)
|
||||
ALTER TABLE products
|
||||
ADD COLUMN IF NOT EXISTS chapters JSONB DEFAULT '[]';
|
||||
|
||||
-- Add chapters support to bootcamp_lessons table
|
||||
ALTER TABLE bootcamp_lessons
|
||||
ADD COLUMN IF NOT EXISTS chapters JSONB DEFAULT '[]';
|
||||
|
||||
-- Add comments for documentation
|
||||
COMMENT ON COLUMN products.chapters IS 'Video chapters/timeline markers stored as JSON array of {time: number, title: string}';
|
||||
COMMENT ON COLUMN bootcamp_lessons.chapters IS 'Video chapters/timeline markers stored as JSON array of {time: number, title: string}';
|
||||
|
||||
-- Create index for faster queries on products with chapters
|
||||
CREATE INDEX IF NOT EXISTS idx_products_has_chapters ON products ((jsonb_array_length(chapters) > 0));
|
||||
|
||||
-- Create index for faster queries on lessons with chapters
|
||||
CREATE INDEX IF NOT EXISTS idx_bootcamp_lessons_has_chapters ON bootcamp_lessons ((jsonb_array_length(chapters) > 0));
|
||||
Reference in New Issue
Block a user