Enhance Google Cast integration, media server reliability, and player…#976
Merged
theovilardo merged 1 commit intomasterfrom Feb 3, 2026
Merged
Enhance Google Cast integration, media server reliability, and player…#976theovilardo merged 1 commit intomasterfrom
theovilardo merged 1 commit intomasterfrom
Conversation
… synchronization
- **Google Cast & Remote Playback**:
- Implements a more robust remote seek mechanism with a state-lock and fail-safe timeout to prevent UI "rubber-banding" during latency.
- Enhances `CastPlayer` with intelligent Content-Type resolution based on file extensions and MIME types.
- Refines remote queue handling to maintain UI consistency when the Cast SDK reports partial queue updates.
- Adds a background status refresh loop to ensure remote playback state (position, play/pause) stays in sync with the UI.
- Improves remote navigation logic in `PlayerViewModel`, prioritizing direct item jumps to avoid race conditions during rapid track changes.
- **Media Server & Networking**:
- Updates `MediaFileHttpServerService` to support range requests and streaming for remote devices, replacing in-memory byte loading with efficient stream copying.
- Refines IP address detection to prioritize LAN-reachable interfaces (Wi-Fi/Ethernet) compatible with Cast discovery.
- Ensures the internal HTTP server correctly handles start/stop actions via explicit intent actions.
- **UI Components**:
- **PlayerSeekBar**: Introduces internal seek state to decouple the thumb position from periodic progress updates while the user is actively scrubbing.
- **CastBottomSheet**: Improves connection state visualization, adding explicit "Connecting" and "Connected" labels for active routes.
- **State Management & Architecture**:
- Refines `PlaybackStateHolder` and `CastTransferStateHolder` to better coordinate state transitions between local and remote playback.
- Updates `PlayerViewModel` to suppress local MediaController listeners when a remote session is active, preventing state conflicts.
- Ensures theme regeneration and lyric loading are triggered consistently during remote track transitions.
- **Bug Fixes & Robustness**:
- Fixes an issue where remote playback would not resume correctly if the queue was perceived as empty.
- Adds safety checks for duration and position values (e.g., `coerceAtLeast(0L)`) to prevent UI glitches with negative timestamps.
- Implements improved resource cleanup for remote progress observers and status jobs in `onCleared`.
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.
… synchronization
CastPlayerwith intelligent Content-Type resolution based on file extensions and MIME types.PlayerViewModel, prioritizing direct item jumps to avoid race conditions during rapid track changes.MediaFileHttpServerServiceto support range requests and streaming for remote devices, replacing in-memory byte loading with efficient stream copying.PlaybackStateHolderandCastTransferStateHolderto better coordinate state transitions between local and remote playback.PlayerViewModelto suppress local MediaController listeners when a remote session is active, preventing state conflicts.coerceAtLeast(0L)) to prevent UI glitches with negative timestamps.onCleared.