Skip to content

add captions support and view counting#161

Draft
usmanpm wants to merge 1 commit intoarbisoft:devfrom
usmanpm:UY-fe-captions
Draft

add captions support and view counting#161
usmanpm wants to merge 1 commit intoarbisoft:devfrom
usmanpm:UY-fe-captions

Conversation

@usmanpm
Copy link
Copy Markdown

@usmanpm usmanpm commented Apr 30, 2026

🚀 Description

Add captions support and view counting functionality to the video player and detail page.

📌 Summary

This PR enhances the video experience by adding support for captions (VTT/SRT files) and implementing automatic view count incrementation after 30 seconds of watch time.

🔧 Changes Implemented

  • ✅ Added captions file support to VideoPlayer component with Track element for subtitles
  • ✅ Implemented view counting logic that increments after 30 seconds of continuous watching
  • ✅ Added view count display in video detail page
  • ✅ Updated EventDetail model to include captions_file and view_count fields
  • ✅ Added CSS styling for captions font size and visibility in preview mode
  • ✅ Added new props to VideoPlayer for captions and watch threshold handling

🛠️ How It Works?

  1. Captions files are passed as props and rendered using Vidstack's Track component
  2. View counting uses an interval to track accumulated watch time, triggering increment when threshold is reached
  3. View count is displayed dynamically and updates after incrementation
  4. Captions are styled with responsive font sizing and visible in preview mode

✅ Checklist Before Merging

  • Tested captions display with VTT/SRT files
  • Verified view count increments correctly after 30 seconds
  • Ensured view count displays properly in video detail page
  • Confirmed captions styling works across different screen sizes

📸 Screenshots (if applicable)

(Add screenshots showing captions enabled and view count display)

🔗 Related Issues

N/A

📢 Notes for Reviewers

  • Check that captions files are properly loaded and displayed
  • Verify the 30-second threshold logic for view counting
  • Ensure the view count mutation updates the UI correctly
  • Test with different video formats and caption file types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant