Amazon Vinyl
    Preparing search index...

    Interface AutoResetController

    Notifies when playback should be reset and retried after a transient, potentially-recoverable error.

    Once an eligible error is set, the controller watches for opportunities to emit a reset event:

    • Immediately when the network transitions back to online
    • After a timeout interval, if online and retries are not exhausted
    • Immediately on user playback actions (play, pause, seeking, playing)

    Each error triggers a single retry timeout. If another error occurs after a reset, AutoResetController.setError should be called again to schedule the next retry attempt.

    interface AutoResetController {
        resetPending: boolean;
        clear(): void;
        hasAnyListeners(): boolean;
        hasListeners(type: keyof AutoResetControllerEventMap): boolean;
        on<K extends keyof AutoResetControllerEventMap>(
            type: K,
            handler: EventHandler<AutoResetControllerEventMap[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
        setError(error: Error): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    resetPending: boolean

    True while an eligible error is being watched and a reset event may still be emitted. Becomes false once the error is cleared, a reset is emitted, or all retries are exhausted.

    Listen to resetPendingChange events for changes.

    • Sets the current playback error and, if eligible, begins watching for retry opportunities.

      An error is eligible when it is a RequestError that did not receive an HTTP response (i.e. response == null), indicating a transient network failure such as connection loss or DNS failure. All other errors — including HTTP failures with a response (4xx/5xx), and non-RequestError errors — are ignored, since those are unlikely to recover on their own.

      Subsequent calls while an error is already set are ignored until the error is cleared via a reset emission or Clearable.clear.

      After a reset, if another eligible error occurs, this method should be called again to schedule the next retry attempt.

      Parameters

      • error: Error

        The error to monitor for retry opportunities

      Returns void