Open
Conversation
|
💖 Thanks for opening this pull request! 💖 Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
2ebb9a9 to
10ac980
Compare
3c3be5d to
90c3f5b
Compare
90c3f5b to
f7e8515
Compare
f7e8515 to
83a499b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9124 +/- ##
==========================================
+ Coverage 84.31% 84.65% +0.34%
==========================================
Files 120 121 +1
Lines 8154 8199 +45
Branches 1964 1971 +7
==========================================
+ Hits 6875 6941 +66
+ Misses 1279 1258 -21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d0a004f to
9a8063f
Compare
mister-ben
reviewed
Dec 7, 2025
test/unit/controls.test.js
Outdated
| player.dispose(); | ||
| }); | ||
|
|
||
| QUnit.test.only('VolumeBar stepBack() sets volume to 0 when slider would go below threshold', function(assert) { |
Contributor
There was a problem hiding this comment.
Suggested change
| QUnit.test.only('VolumeBar stepBack() sets volume to 0 when slider would go below threshold', function(assert) { | |
| QUnit.test('VolumeBar stepBack() sets volume to 0 when slider would go below threshold', function(assert) { |
Coverage ought to pass without the only left in.
a29c8bb to
3a8ff94
Compare
mister-ben
approved these changes
Dec 7, 2025
amtins
approved these changes
Jan 11, 2026
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses: #8498
This PR adds support for logarithmic (perceptual) volume control to Video.js, providing a more natural audio experience that better matches human perception of loudness. When enabled via the
logarithmicVolumeoption, the volume slider uses decibel-based scaling where linear slider movements produce logarithmic volume changes, making volume adjustments feel more consistent across the entire range.The Problem:
As discussed in issue #8498, traditional linear volume control doesn't match how humans perceive sound. With linear scaling:
Specific Changes proposed
Logarithmic volume control solves this by using decibel (dB) scaling, the audio engineering standard that matches human hearing perception (source). This implementation provides finer control at lower volumes where precision matters most - the first 50% of the slider covers roughly 0-6% of actual volume. This solution remains fully backward compatible - linear volume remains the default behavior.
Usage:
New
VolumeTransferclass:src/js/utils/volume-transfer.js- Volume transfer functions for converting between slider position and player volumeVolumeTransfer(base class),LinearVolumeTransfer(default, maintains current behavior), andLogarithmicVolumeTransfer(decibel-based scaling)Updates to
VolumeBar:src/js/controls/volume-control/volume-bar.jsinitVolumeTransfer_()to initialize transfer function based onlogarithmicVolumeoptionhandleMouseMove(),getPercent(),stepForward(), andstepBack()to use transfer functionsNew Player Options:
logarithmicVolumeoption (boolean, default: false)Added
logarithmicVolumeRangeoption (number, default: 50)Tests:
test/unit/utils/volume-transfer.test.js- Test suite covering both transfer implementationsTest Page:
https://christriants.github.io/video.js/sandbox/logarithmic-volume.html
Requirements Checklist
npm run docs:apito error