Skip to content

fix(android): allow background video in embedded views - #2308

Merged
houko merged 4 commits into
nsgo-dev:mainfrom
henry-wm:codex/android-background-video
Nov 26, 2026
Merged

houko merged 4 commits into
nsgo-dev:mainfrom
henry-wm:codex/android-background-video

Conversation

@henry-wm

@henry-wm henry-wm commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #2302.

  • Add NsgoView.setBackgroundVideoPlaybackEnabled(true) for Android hosts that keep the same view and engine in a media playback foreground service.
  • Keep the player and its Go callbacks running when the view is hidden or removed from its window. An explicit engine detach still releases the native tree and its players.
  • Cover the default visibility pause, opt-in progress and completion, repeat, reattachment, and explicit detach in an Android regression test.

Targets

  • Android

Screenshots

None.

Verification

  • go tool nsgo check
  • go tool nsgo check -target android -jobs 2
  • Rebuilt the Android runtime with internal/platform/android/runtime/build.sh in a temporary directory.
  • go tool nsgo test ./internal/platform/android passed 154 host tests.
  • go tool nsgo test passed 4,860 tests. TestMaxRefreshRateReadsEveryMode also failed on the unmodified upstream base on this Mac.
  • The Android emulator regression runs in the pull request's Test workflow.

Checklist

  • Conventional Commit title.
  • Embedding docs, skill, and changelog fragment updated.

🤖 GPT-6

@github-actions github-actions Bot added bug Something isn't working size/M documentation Improvements or additions to documentation Android ci labels Nov 24, 2026
@houko houko self-assigned this Nov 25, 2026

@houko houko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The implementation and focused Android check match issue #2302, and the new background-video test is present. I cannot approve this pull request in its current state.

  • GitHub reports the pull request as conflicting with main (mergeStateStatus: DIRTY).
  • The Android Test workflow failed at internal/testhost/testdata/keys/mobilekeys_test.go:150 in TestAndroidHardwareKeysReleaseOnWindowLoss.
  • The changed workflow line in .github/workflows/test.yml therefore does not have a green full-workflow result.

Please rebase onto current main, resolve the conflict, and rerun the complete required checks. The focused local check go tool nsgo check -target android ./internal/platform/android passes.

@henry-wm
henry-wm force-pushed the codex/android-background-video branch from f66ca9d to 2703f91 Compare November 25, 2026 11:37

@houko houko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Source-level review against #2302. The option is threaded from nsgo.Launch through both desktop host backends into NsgoView, and the hidden-video path keeps the same native tree only while the host opted in. VideoNode moves progress callbacks to the engine UI handler, clears surfacePlaying on pause/release, and still destroys players on explicit detach. The native regression covers visibility pause, opt-in playback, removal from the window, repeat completion, reattachment, and explicit detach. I found no source-level defect in the implementation. The PR still needs its branch conflict and failed required Android workflow resolved before merge.

@houko
houko merged commit c560ff6 into nsgo-dev:main Nov 26, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android bug Something isn't working ci documentation Improvements or additions to documentation size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: opt-in background playback for embedded NsgoView

2 participants