Skip to content

Add video playback quality selector - #305

Open
Idahjnr007 wants to merge 4 commits into
Hamplard-Hub:mainfrom
Idahjnr007:Add-Video-Playback-Quality-Selector
Open

Add video playback quality selector#305
Idahjnr007 wants to merge 4 commits into
Hamplard-Hub:mainfrom
Idahjnr007:Add-Video-Playback-Quality-Selector

Conversation

@Idahjnr007

Copy link
Copy Markdown
Contributor

Closes #186

Added VideoQualityLevel type: 'auto' | '1080p' | '720p' | '480p' | '360p'
Added VideoQualities interface with optional URL fields per resolution
Added optional videoQualities?: VideoQualities to the Lesson interface
VideoControls.tsx

Added quality, videoQualities, onQualityChange to props
The dropdown is only rendered when videoQualities has at least one URL (so lessons without quality variants show nothing)
Dropdown opens upward above the controls bar to avoid clipping
Selected quality gets a saffron dot indicator; the button label shows the active resolution (or "Quality" for Auto)
Click-outside handler closes the menu cleanly
Used a custom

    instead of a native so it can be styled to match the dark player chrome VideoPlayer.tsx Added videoQualities prop Added quality + activeSrc state; activeSrc is what the actually reads Added pendingSeekRef and pendingPlayRef refs to stash position and play-state before the src swap handleQualityChange — captures current time and play state, then updates activeSrc handleCanPlay — fires after the new source is ready, seeks to the saved position and resumes playback if it was playing useEffect on src resets everything back to Auto when the lesson changes onCanPlay wired to the element src/app/dashboard/courses/[id]/learn/page.tsx Passes videoQualities={activeLesson.videoQualities} to Closes #186

Added Autoplay Next Lecture Toggle in Video Player.

Implemented an autoplay next lecture toggle in the video player so students can choose whether the next lecture starts automatically after the current one ends.

📋 Requirements

Added an "Autoplay" toggle switch in VideoControls.tsx
Default: on
Persist preference in localStorage per user
When lecture ends and autoplay is on: 5-second countdown overlay showing "Next: [lecture title]", then auto-navigate
Cancel button during countdown cancels autoplay
When autoplay is off: show "Next lecture" button on video end
Added Video Playback Quality Selector

Built a video playback quality selector so students on slower connections can reduce video quality to prevent buffering.

📋 Requirements

Add quality selector button to VideoControls.tsx: Auto, 1080p, 720p, 480p, 360p
When a quality is selected, switch the video src to the matching resolution URL
Maintain current playback position when switching quality
Show current quality label in button when not Auto
"Auto" uses the browser's adaptive bitrate streaming
🔧 Technical Scope

HTML5 video src switching
src/components/learn/VideoControls.tsx
📂 Affected Path

src/components/learn/VideoControls.tsx
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Idahjnr007 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[Frontend] Enhancement: Add Video Playback Quality Selector

1 participant