feat(streaming): buffer resilience and automatic reconnection
- Construct the audio player with an enlarged live-stream buffer (15-50s forward cushion, 2.5s to start, 5s after rebuffer) so short network drops play through silently - Add reconnect-on-stall state machine with bounded exponential backoff (1/2/4/8/16s, ~90s total window, 5 attempts) that re-prepares to the live edge; backoff/decision logic extracted to controlador_reconexion.dart as pure testable code - Surface a new reconnecting playback state in the mini player and full player (localized in all 13 locales) instead of error dialogs during the retry window; a single friendly error appears only after exhaustion - Guard interplay: user pause/stop cancels retries, audio interruptions cancel reconnect, alarm wake-up path keeps precedence, recording fails cleanly during drops - Reset retry budget on station change; route stream timeouts through the network-error class - 10 new tests (99 total green), flutter analyze clean
This commit is contained in:
@@ -284,6 +284,10 @@ class ServicioGrabacionRadio {
|
||||
_emitir(const EstadoGrabacionRadio.inactiva());
|
||||
}
|
||||
|
||||
// S7-R5 invariant: recording uses its OWN HTTP stream, independent of
|
||||
// PluriWaveAudioHandler. Its error handling must NOT route through the S7
|
||||
// reconnect machine (ControladorReconexion) — a recording failure clears
|
||||
// state and releases resources immediately, with no backoff retries.
|
||||
Future<void> _fallar(Object error) async {
|
||||
_timerAutoStop?.cancel();
|
||||
_timerAutoStop = null;
|
||||
|
||||
Reference in New Issue
Block a user