-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Plugin] Precise volume control #236
Merged
Merged
Conversation
This file contains 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
(if hide-video-player plugin is disabled)
th-ch
approved these changes
Apr 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good and seems to work fine, thanks for the contribution! Just a comment to make the code defensive and then it should be good to merge 👍
Co-authored-by: th-ch <[email protected]>
th-ch
approved these changes
May 2, 2021
Looks ok, thanks for the contribution, merging! ✅ |
2 tasks
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.
precise-volume
pluginThe original volume slider and shortcuts lets you control volume only in steps of 5% or 10%,
this has always bothered me, there isn't enough control - especially around the lower percentages
So I made this small plugin to fix that (name could be changed):
Features
You can now have precise control over volume percentage by using mouse-wheel in play bar area (bottom bar)
each step add/subtract [1%] (default can be changed)
Optional setting to change volume with local hotkey - arrowkeys up/down (Like in native youtube)
Advanced option in config to setup global hotkeys
Advanced option to change volume steps (int 1-100 representing percentage change)
Will use prompt
type: "Counter"
to allow controlling this setting once the custom prompt from Menu tweaks #224 gets implementedPlugin also makes the Volume slider + icon tooltip's always show the exact current volume percentage
Precise volume is saved and restored between sessions
Misc
To override the default mousewheel + arrowkey behavior of the volume bar, I had to do a trick before DOMContent loaded
(The only way to remove an eventListener created with an anonymous function is to catch it before its created)
Initially I just added the code to the main preload.js but later thought it would probably be better to enable all plugins to do some preload
so, I added an option for Every Plugin to add a preload.js to be executed from Renderer before DOMContent loaded
Note on the original volume slider
For example, there is no visual difference between 5% and 7%
(that's pretty much the main reason I added the tooltip with volume percentage)
I'm not too sure how to visually modify the slider itself without native youtube functionality breaking, if it's even possible