Skip to content

feat: add pauseOnBackground control for Android and iOS#201

Open
kdroidFilter wants to merge 1 commit intomasterfrom
feat/background-playback-control
Open

feat: add pauseOnBackground control for Android and iOS#201
kdroidFilter wants to merge 1 commit intomasterfrom
feat/background-playback-control

Conversation

@kdroidFilter
Copy link
Copy Markdown
Owner

Summary

  • Add pauseOnBackground property to VideoPlayerState (defaults to true, preserving current behavior)
  • Android: Use LifecycleEventObserver to pause on ON_STOP and resume on ON_START, skipping when PiP is active
  • iOS: Gate the existing background/foreground observers with the new flag so playback can continue uninterrupted
  • Update README with documentation and platform behavior table
  • Fix podspec resource path separators (backslash → forward slash)

Test plan

  • Verify default behavior: video pauses on background, resumes on foreground (Android & iOS)
  • Set pauseOnBackground = false and confirm audio continues in background
  • Verify PiP playback is unaffected by the flag on both platforms
  • Confirm no regressions on desktop/web (flag accepted but ignored)

Allow opting out of automatic pause/resume when the app moves to/from
background. Defaults to true (current behavior). When set to false,
audio continues playing in the background. PiP playback is unaffected.
Also fixes podspec resource path separators and a minor iOS import order.
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.

1 participant