Files
iptvnator/docs
8508010ea5 fix(playback): resume an episode whose connection drops instead of skipping it (#1902) (#1908)
* fix(playback): resume an episode whose connection drops instead of skipping it (#1902)

Embedded MPV sessions run with keep-open, so a provider that closes the
connection mid-episode (and refuses ffmpeg's own reconnect) reaches the app
as eof-reached: status `ended` at the drop position. The reconnect policy
counted `ended` as a loss only for live playback, so on VOD it stood for
the end of the file and series autoplay started the next episode.

- The reconnect policy now treats a VOD `ended` with more than
  max(10 s, 1 % of the duration) left as a dropped connection and reloads
  it at the last position. A reload that ends again before getting 5 s past
  where it resumed proves the file ends there (bitrate-estimated duration),
  so it is left as the end and autoplay continues after one attempt.
- The service passes the snapshot duration to the policy.
- The player emits playbackEnded only for an `ended` session without a
  pending reconnect.
- Xtream mock: `streamdrop` scenario whose episodes drop a third of the way
  into a local 60 s clip and refuse the retry for 4 s; Electron E2E covers
  the native-view engine (skips without an Embedded MPV runtime).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(playback): keep the early-EOF retry on a refused reload or after a seek

The resume point that tells a reload ending where it resumed from a new
drop was recorded before the reload ran, so a reload the addon refused made
the original EOF look like the end and the next poll cancelled the retry.
Record it only once the reload started, and forget it when the user seeks:
an EOF after a seek is judged on its position alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(e2e): fail the stream-drop resume check when the reload restarts the episode

A reload that started the episode over would also reach the 25 s mark
within the timeout, since the mock drops each episode only once. Every
position played after the drop must now stay within 3 s of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: 4gray <fourgray@proton.me>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 20:23:30 +02:00
..