mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-05-03 02:01:29 -05:00
VideoScrollWheel: Add new option for volume change (#279)
Co-authored-by: DogmaDragon <103123951+DogmaDragon@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
name: VideoScrollWheel
|
||||
description: Adds functionality to change volume/time in scene video player by hovering over left/right side of player and scrolling with mouse scrollwheel. Scroll while hovering on left side to adjust volume, scroll on right side to skip forward/back.
|
||||
version: 0.1
|
||||
version: 0.2
|
||||
settings:
|
||||
allowVolumeChange:
|
||||
displayName: Volume change via mouse wheel
|
||||
description: Allow volume to be changed via mouse wheel. When disabled it always changes video position.
|
||||
type: BOOLEAN
|
||||
volumeScrollSpeed:
|
||||
displayName: Volume Scroll Speed
|
||||
description: (Default=100.0) Scales the amount of change in volume per mouse wheel click. Negative value reverses scroll direction.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
let scrollVelocity = 1;
|
||||
let previousTime = Date.now();
|
||||
let pluginSettings = {
|
||||
allowVolumeChange: false,
|
||||
volumeScrollSpeed: 100.0,
|
||||
timeScrollSpeed: 100.0,
|
||||
timeScrollAcceleration: 100.0,
|
||||
@@ -46,7 +47,7 @@
|
||||
|
||||
var scrollDelta = e.deltaY;
|
||||
|
||||
if (targetWidth / 2 > targetX) {
|
||||
if (targetWidth / 2 > targetX && pluginSettings.allowVolumeChange) {
|
||||
// Scrolled on left side, change volume.
|
||||
var newVolume =
|
||||
vjsPlayer.volume() +
|
||||
|
||||
Reference in New Issue
Block a user