Automatically detects and skips silent portions of videos to save time during playback.
import AdaptiveVideoPlayer from '@/components/AdaptiveVideoPlayer';
<AdaptiveVideoPlayer
sources={[{ quality: '720p', url: '/video.mp4' }]}
lessonId="lesson-1"
enableSilenceSkip={true} // ← Add this
/><AdaptiveVideoPlayer
sources={[{ quality: '720p', url: '/video.mp4' }]}
lessonId="lesson-1"
enableSilenceSkip={true}
silenceThreshold={20} // Adjust sensitivity (5-50)
minSilenceDuration={1.5} // Min silence to skip (seconds)
onSilenceSkip={(start, end) => console.log('Skipped:', start, end)}
/>- Play your video
- Click the "Skip Silence" button in controls to toggle on/off
- Watch silent portions get automatically skipped!
✅ Hook: useSilenceDetector - Core silence detection logic
✅ UI Component: AutoSkipSilenceControls - Toggle button & status display
✅ Integration: Added to all 3 video players (AdaptiveVideoPlayer, VideoPlayer, VideoPlayerSync)
✅ Demo Page: /auto-skip-silence-demo - Test and configure
✅ Tests: Unit tests for hook and UI component
✅ Docs: Complete documentation in AUTO_SKIP_SILENCE_FEATURE.md
| Setting | Default | Description |
|---|---|---|
enableSilenceSkip |
false |
Turn feature on/off |
silenceThreshold |
20 |
Audio level threshold (0-255) |
minSilenceDuration |
1.5 |
Minimum silence duration (seconds) |
For Lectures:
silenceThreshold={25}
minSilenceDuration={1.0}For Tutorials:
silenceThreshold={20}
minSilenceDuration={1.5}For Music/Performances:
silenceThreshold={15}
minSilenceDuration={3.0}- Blue = Active (skipping enabled)
- Gray = Inactive (skipping disabled)
- Icon changes: Volume2 (on) / VolumeX (off)
- "Skipping..." - Appears when silence is being skipped
- "Saved: X:XX" - Shows total time saved
npm run dev
# Visit: http://localhost:3000/auto-skip-silence-demonpm test -- useSilenceDetector
npm test -- AutoSkipSilenceControls<VideoPlayer
videoId="video-1"
videoUrl="/lecture.mp4"
title="Introduction to Blockchain"
enableSilenceSkip={true}
/><VideoPlayerSync
videoId="video-2"
src="/tutorial.mp4"
enableSilenceSkip={true}
silenceThreshold={25}
minSilenceDuration={1.0}
/><AdaptiveVideoPlayer
sources={[{ quality: '720p', url: '/course.mp4' }]}
lessonId="lesson-5"
enableSilenceSkip={true}
onSilenceSkip={(start, end) => {
analytics.track('silence_skip', { start, end });
}}
/>- Analyzes video audio in real-time using Web Audio API
- Detects when audio level drops below threshold
- Waits for minimum duration to confirm it's silence
- Skips forward automatically
- Tracks total time saved
- ✅ Detect silence - Real-time audio analysis
- ✅ Skip automatically - Seamless forward seeking
- ✅ Toggle feature - Easy on/off control
Feature not working?
- Check that
enableSilenceSkip={true}is set - Ensure video has audio track
- Try adjusting
silenceThresholdlower (more sensitive)
Skipping too much?
- Increase
silenceThreshold(less sensitive) - Increase
minSilenceDuration(skip only longer silences)
Not skipping enough?
- Decrease
silenceThreshold(more sensitive) - Decrease
minSilenceDuration(skip shorter silences)
- Full Documentation:
AUTO_SKIP_SILENCE_FEATURE.md - Implementation Details:
AUTO_SKIP_SILENCE_IMPLEMENTATION.md - Source Code:
src/hooks/useSilenceDetector.ts - Demo:
/auto-skip-silence-demo
You're ready to save time by automatically skipping silence in your videos!