Auto Reset Logic
The Amazon 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
- The
VinylPlayerforwards all error events to theAutoResetController - Only
SERVICE_INTERNALReportableErrorinstances trigger auto-reset behavior - Other error types (e.g.,
SERVICE_EXTERNAL,MEDIA,API) are ignored
Reset Triggers
The controller monitors for retry opportunities and emits reset events in these scenarios:
- Network Recovery: Immediately when the device comes back online
- Timed Retry: After
retryIntervalseconds if the device is online and retry limit not exceeded - User Actions: Immediately on user-initiated playback events:
playpauseseekingplaying
Reset Process
When a reset is triggered:
- All controllers are reset by
VinylPlayer:DrmController,PlaybackController,TrackController - Error state is cleared
- Retry counter is reset to 0 (for user actions only)
- A
resetevent is dispatched
Retry Limits
- Maximum retries:
maxRetries(default: 30) - Retry interval:
retryIntervalseconds (default: 30) - User actions reset the retry counter, allowing unlimited user-initiated retries
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
- VinylPlayer: Forwards errors to controller, listens for reset events
- DrmController: Retries failed license requests on reset
- PlaybackController: Handles media element recovery
- TrackController: Resets current track state
- NetworkState: Monitors online/offline status
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