Skip to content

Fix trailer autoplay in background without resetting focus state#235

Open
kernexshadow wants to merge 2 commits intotapframe:devfrom
kernexshadow:fixTrailerAndroidHome
Open

Fix trailer autoplay in background without resetting focus state#235
kernexshadow wants to merge 2 commits intotapframe:devfrom
kernexshadow:fixTrailerAndroidHome

Conversation

@kernexshadow
Copy link
Contributor

Summary

This PR fixes trailer autoplay starting while the app is in the background (after pressing Home), and preserves the current focused/expanded context when returning to the app.

What changed

  • Added lifecycle RESUMED gating to trailer/autoplay flows in:
    • ContentCard (classic focused/expanded poster flow)
    • ModernHomeContent (expanded card and hero trailer autoplay flow)
  • Added app foreground/background event handling in detail screen flow:
    • New event: OnAppForegroundChanged
    • MetaDetailsScreen now reports lifecycle foreground changes
    • MetaDetailsViewModel cancels idle autoplay timer when app goes background
  • Kept focus/expanded state intact on app resume (no forced reset to first poster/profile screen behavior from this fix).

Result

  • Trailer autoplay no longer starts while the app is outside foreground.
  • Returning to the app keeps the previous navigation/focus context instead of resetting it.

Closes #234

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.

When trailer autoplay is enabled, trailers can start playing after the app is sent to the Android home screen.

2 participants