Skip to content

Enhance Google Cast integration, media server reliability, and player…#976

Merged
theovilardo merged 1 commit intomasterfrom
fix/cast-connection-ui
Feb 3, 2026
Merged

Enhance Google Cast integration, media server reliability, and player…#976
theovilardo merged 1 commit intomasterfrom
fix/cast-connection-ui

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

… 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.

… 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`.
@theovilardo theovilardo merged commit a49449c into master Feb 3, 2026
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.

1 participant