refactor: concentrate Cast ownership and preserve intent on disconnect
This commit is contained in:
@@ -213,6 +213,10 @@ The Cast icon uses 15 points in the titlebar and 17 points in compact controls,
|
||||
|
||||
Terebi pauses local output before transferring the acknowledged position and play/pause intent to Google's Default Media Receiver. The existing controls, keyboard shortcuts and macOS media commands control remote playback, seeking, volume/mute and resolved-source subtitles. **Play on This Mac** restores receiver-confirmed position and intent; local volume is preserved independently. Connection/load failures return to local playback with an error. Opening another source ends casting and opens it locally. Frame stepping and YouTube quality changes are local-only; automatic quality is suspended while casting.
|
||||
|
||||
`PlayerModel.CastPlaybackTransition` owns the Cast lifecycle, receiver-state projection, pending playback intent, cancellation and return-to-local decision. `PlayerModel` applies its observations to presentation, acknowledged progress and existing local restoration. `CastSession` retains receiver-protocol ownership; `CastMediaServer` retains cancellation-safe delivery lifetime.
|
||||
|
||||
Recoverable command failures and terminal disconnection are separate observations: disconnecting with pending controls must not clear the latest playback intent before local restoration chooses its playing or paused state.
|
||||
|
||||
TLS connection establishment has a twelve-second deadline; cold receiver launch has a separate thirty-second deadline and accepts validated asynchronous readiness without waiting for the original launch acknowledgement. Volume controls retain the latest requested value until its acknowledgement, ignore older feedback, and do not reposition the native slider during a drag. External TV volume changes still update idle controls.
|
||||
|
||||
The Mac serves session-only capability URLs over HTTP. Keep it awake and connected, and allow incoming connections through its firewall. The relay exposes only the chosen media and subtitle resources, never arbitrary filesystem paths or a general URL proxy. Disconnect, replacement and quit cancel delivery and invalidate the listening endpoint.
|
||||
@@ -229,6 +233,8 @@ The Cast channel accepts the selected receiver's self-signed TLS certificate: en
|
||||
|
||||
Authenticated multi-variant HLS regressions gate upstream responses and verify no unused-quality downloads or duplicate retained-media reads, nearby rewinds, distant cache misses, decoded A/V positions and AAC continuity, and cancellation while upstream remains blocked. Native network playback checks cover the shared reader's existing callers.
|
||||
|
||||
The player handoff checks also gate receiver launch and LOAD to exercise cancellation, LOAD rejection after local pause, replacement/close/shutdown during pending and active Cast, and late receiver replies. Disconnect recovery preserves the latest playback intent, acknowledged position, stable bookmarks and independent local volume even with an unacknowledged remote seek.
|
||||
|
||||
## Resume playback
|
||||
|
||||
Reopening a local video, YouTube video or resolved Miruro episode automatically resumes its saved position, including after quitting and relaunching the app. Local files use their resolved file paths; YouTube uses the canonical video webpage URL; Miruro uses its opaque media ID and episode number. Newly resolved addresses therefore share progress without saving CDN tokens as identity. The app does not automatically reopen the last video on launch.
|
||||
|
||||
Reference in New Issue
Block a user