Skip to content
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

precise-volume plugin fixes & updates #275

Merged
merged 16 commits into from
Oct 24, 2021
Merged

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented May 12, 2021

Adds a HUD that show current volume

it is displayed when volume percentage change, and fade out after a second

If video is disabled (hide-video plugin enabled)

HUD is displayed in the navbar since its pretty much the only place that is consistently visible
('playbar' have no space for elements when window is small)

Screenshot with hide-video

hide-video

If video is enabled

HUD is displayed in the top left corner of the video player.
also works when minimized (video is shown in mini-player, volume control and hud works from there)

Screenshot with video

video

Screenshot with mini-video

mini-player


Sidenote :
I know there is utils.elementFromFile etc, buts since the element is so small, it's much shorter to just directly use Element.insertAdjacentHTML (its just one line of html)

Fixed various bugs by using native youtube api to change the volume

  • youtube overriding precise volume on song start or randomly while playing
  • video muting itself when volume<3
  • video volume rounding to multiples of 5 on start

Other misc fixes

  • Fixed plugin rewriting config on each volume step (by having a 1500 millisecond timeout before writing)
  • use window.load event from front instead of webContents.did-finish-load event from back
    • [preload.js] once - remove addEventListener override
    • [front.js] on - inject custom HUD based on $(#main-panel).style.display == none(hide-video plugin enabled)

@Araxeus Araxeus mentioned this pull request May 18, 2021
@Araxeus Araxeus mentioned this pull request Oct 5, 2021
@Araxeus Araxeus changed the title add volume hud to precise-volume plugin precise-volume plugin fixes & updates Oct 23, 2021
Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the improvement!

@th-ch th-ch merged commit 6a2e3ab into th-ch:master Oct 24, 2021
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.

2 participants