Skip to content

fix(mobile): pause background video play #17032

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

Merged
merged 6 commits into from
Mar 28, 2025
Merged

Conversation

YarosMallorca
Copy link
Collaborator

Description

Fixes #16983

How Has This Been Tested?

  • Go to a video, and minimize the app while the video is playing: video stops playing until the app is brought to the foreground
  • Pause the video playback manually, take it to the background and bring it back to the foreground: video doesn't play automatically

Copy link

@lyagr lyagr left a comment

Choose a reason for hiding this comment

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

Cheers 😊

Copy link
Member

@shenlong-tanwen shenlong-tanwen left a comment

Choose a reason for hiding this comment

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

I've tested the changes on an android emulator and the video gets paused when the app is paused and plays when the app is resumed, unless it was manually paused before going out. Thanks for working on this

@alextran1502 alextran1502 merged commit d2bcf5d into main Mar 28, 2025
44 checks passed
@alextran1502 alextran1502 deleted the fix/background-video-play branch March 28, 2025 15:32
kirill-dev-pro pushed a commit to kirill-dev-pro/immich-but-with-public-albums-within-instance that referenced this pull request Apr 6, 2025
* fix(mobile): prevent background video playback

* fix: logic for tracking app state

* chore: move lifecycle handler in separate file

* chore: replace useState with useRef

* chore: useOnAppLifecycleStateChange

* fix: removed print statement
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
* fix(mobile): prevent background video playback

* fix: logic for tracking app state

* chore: move lifecycle handler in separate file

* chore: replace useState with useRef

* chore: useOnAppLifecycleStateChange

* fix: removed print statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android app: videos play in background
4 participants