Auto Reset Logic

The Vinyl player includes automatic error recovery through the AutoResetController, which monitors for playback errors and attempts to recover from transient failures.

How It Works

Error Detection

Reset Triggers

The controller monitors for retry opportunities and emits reset events in these scenarios:

  1. Network Recovery: Immediately when the device comes back online
  2. Timed Retry: After retryInterval seconds if the device is online and retry limit not exceeded
  3. User Actions: Immediately on user-initiated playback events:
    • play
    • pause
    • seeking
    • playing

Reset Process

When a reset is triggered:

  1. All controllers are reset by VinylPlayer: DrmController, PlaybackController, TrackController
  2. Error state is cleared
  3. Retry counter is reset to 0 (for user actions only)
  4. A reset event is dispatched

Retry Limits

Configuration

const player = createVinylPlayer({
    autoResetController: {
        enabled: true, // Enable/disable auto-reset (default: true)
        maxRetries: 30, // Max automatic retries (default: 30)
        retryInterval: 30, // Seconds between retries (default: 30)
    },
})

Integration Points

Debugging

Enable debug logging (?vinylLogLevel=debug) to monitor auto-reset behavior:

// Look for these log messages (filter on 'reset'):
// "setError" - Error monitoring started
// "online, emitting reset" - Network recovery triggered
// "interval, emitting reset" - Timeout retry triggered
// "max retries exhausted" - Retry limit reached