refactor(player): modularise the video player and make it adaptive - #1046
Merged
Merged
Conversation
…d drag math into their own files
…allback instead of GlobalPlayerState
…adius into player tokens
…croll and backdrop files
…llapse drag cannot be cancelled mid-gesture
…hrow is not read as a dismiss fling
…formatters, download stream policy and geometry
…he into the video view model through transitional providers
…ounts per cause and the collector leak
…est gate covers them
…ls overlay, download dialogs and layout modes with Compose tests
… sheets, dialogs and host into their feature packages
…istory, auto-hide, window and load files
…solver so it stops colliding with the media source resolver
…d live watch fetches onto PlayerSecondaryMetadataLoader
…r and only poll while a panel is showing it
…ed prewarm onto WatchSessionTracker
…shared VideoEngagementUseCase and adopt it in shorts and quick actions
…t keeps one request per video in flight and adopt it in shorts
…ng on UpcomingPremierePolicy
…the view model applies
…backStreamPreparer
…and a player state mirror
…engagement writes onto their own controller
…y metadata on PlaybackSessionApplier
…nder onto UpcomingPremiereController
…egate the recovery, settings and presence surfaces off the view model
…d of at the half-way mark of the morph
…dow size class and delete the four breakpoint tables and the form-factor helpers
…nded-width windows with medium height and reserve its width for the content and the mini player
…de mode from the window size class with the 840 dp width and 480 dp height rule and keep the mini player clear of the rail
…n through the compose BOM for the player detail panes
…caffold and size the expanded video from the same pane directive
…p timer in the supporting pane and the fullscreen drawer, and fold the subtitle style sheet into the settings sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modularises the video player and makes it adaptive. The 3,689-line view model becomes a 594-line orchestrator over pure reducers and single-purpose collaborators, the player's sheets, controls, overlays and gestures move into
ui/components/videoplayer/andui/components/shared/with one bottom-sheet scaffold and one sealed open-sheet state, and layout decisions come from the platformWindowSizeClass: adaptive feed grids, aWideNavigationRailon expanded windows, and aSupportingPaneScaffoldplayer detail that also hosts the description, chapters, settings pages and sleep timer beside the video.Related issue
None. The supporting-pane behaviour follows the earlier side-column work from #918.
Change type
Validation
./gradlew :app:assembleGithubDebug./gradlew :app:testGithubDebugUnitTest— 1,626 run, 2 skipped, 0 failures (Compose UI tests now run in the JVM through Robolectric):app:compileFossDebugKotlinTest device and Android version: POCO (1220×2712, HyperOS) for the sheet, controls and frame passes; Android Studio resizable emulator (API 36, tablet mode) for the 840×1200 and 1280×800 dp windows, the pane takeovers and the fullscreen drawer.
Risk and compatibility
No database or preference migrations. No new permissions.
New dependencies, all BOM-pinned:
androidx.window:window/window-core1.5.0 (already in the APK transitively, now declared),androidx.compose.material3.adaptive:adaptive-layout/adaptive-navigation1.3.0, Robolectric 4.16.1 for tests.Playback path (player managers, media session, services) is untouched; the view model split keeps every player call on one preparer. Comments load once the sheet has settled; position and premiere polls are lifecycle-gated; the live-chat loop runs only while a panel shows it.
Behaviour changes: two-pane player at ≥ 840 dp width with a 480 dp height guard (a 600–839 dp tablet in landscape now gets one column with a two-column related grid); subtitle style is a page of the settings sheet; feed columns come from
GridCells.Adaptive.The change does not introduce secrets, private data, or unexpected telemetry.
New user-facing text uses Android string resources.
Dependency and lockfile changes are intentional and limited to this PR.
Room schema changes include the required version bump and migration, or this PR does not change the Room schema.
Breaking changes and upgrade steps are clearly documented.