# TiviLux Native v0.4.56 / Build 72 — Live Channel Connection Handoff Fix

## Reported symptom
During rapid Live TV channel changes, XUI's Live Connections page could temporarily show several previously viewed channels for the same device/IP. Those entries eventually disappeared, but the panel could look as if one TiviLux device was holding multiple streams open.

## Source finding
TiviLux already uses one shared ExoPlayer for normal single-channel Live TV. The managed live session stopped the player and immediately replaced the MediaItem. That avoids creating a second player, but it did not explicitly clear the outgoing MediaItem before starting the next URL, and it gave the playback/network thread no drain interval between the old continuous IPTV request and the replacement request.

The process-wide HTTP keep-alive setting is retained because it benefits API/EPG/artwork traffic and changing it globally would be a broader regression risk.

## Fix
`ui/components/LivePlaybackSession.kt` now performs a hard handoff whenever a fresh live source is prepared:

1. Disable `playWhenReady` on the outgoing stream.
2. `stop()` the shared player.
3. `clearMediaItems()` so Media3 releases the outgoing MediaSource/DataSource instead of relying only on replacement semantics.
4. When the next URL differs from the outgoing URL, wait 180 ms before opening it. Because this runs inside the existing URL-keyed `LaunchedEffect`, another channel selection cancels the pending handoff before it can open a stale intermediate channel.
5. Set, prepare, and play the new source on the same shared ExoPlayer.

Recovery of the same URL does not incur the drain delay; only actual source transitions do.

## Expected behavior
When one device changes A → B → C, TiviLux should stop consuming A before opening B and stop B before opening C. XUI can still retain a closed row briefly because its own live-connection cleanup is server-side, but old TiviLux channels should not remain actively consumed by the client.

## Scope
No changes to Xtream authentication, credentials, Guide navigation, Favorites, Sports, VOD, MultiView, profiles, Settings UI, HLS candidate ordering, or fullscreen surface behavior.
