Skip to content

Conversation

@jackdrowlands
Copy link
Contributor

@jackdrowlands jackdrowlands commented Jun 27, 2025

Summary

Implements user-configurable delays for auto-pause functionality to resolve issues where brief speaker pauses caused unwanted music resumption during YouTube videos.

Fixes #203

Changes

  • New preferences UI with logarithmic sliders for fine control at small values
  • Configurable delays: 0ms (disabled) to 10000ms for both pause and unpause delays
  • Default values: 1500ms pause delay, 3500ms max unpause delay
  • Persistent storage via NSUserDefaults with proper validation
  • Zero-delay support for immediate pause/unpause behavior

Test plan

  • Build completes successfully
  • UI displays correctly in preferences menu
  • Sliders provide logarithmic scaling for fine control
  • Zero delays disable respective functionality
  • Settings persist across app restarts
  • YouTube video pause issue resolved

Technical Details

  • Added pauseDelayMS and maxUnpauseDelayMS properties to BGMUserDefaults
  • Modified BGMAutoPauseMusic to use configurable delays instead of hardcoded constants
  • Created new preferences UI with logarithmic sliders for better UX at small values
  • Proper validation and clamping of delay values (0-10000ms range)
  • Zero-delay handling for immediate behavior when delays are disabled

Implements user-configurable delays for auto-pause functionality to resolve
issues where brief speaker pauses caused unwanted music resumption during
YouTube videos. Users can now adjust both pause delay (time before pausing
music when other audio starts) and max unpause delay (time before resuming
music when other audio stops).

Features:
- New preferences UI with logarithmic sliders for fine control at small values
- Range: 0ms (disabled) to 10000ms for both delays
- Default values: 1500ms pause delay, 3500ms max unpause delay
- Persistent storage via NSUserDefaults
- Zero-delay support for immediate pause/unpause behavior
@kyleneideck kyleneideck merged commit cb804ec into kyleneideck:master Jun 29, 2025
0 of 2 checks passed
@kyleneideck
Copy link
Owner

Works great, thanks.

Richc pushed a commit to Richc/BackgroundMusic that referenced this pull request Dec 10, 2025
…rable-auto-pause-delays

Add configurable auto-pause delays for YouTube video compatibility
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.

Preference for time to wait before resuming playback

2 participants