Skip to content

[Enhancement] Add video player crash recovery with automatic position resume #668

Description

@RUKAYAT-CODER

Overview

The video player crashes silently on codec errors, DRM failures, and network interruptions during playback — returning to a black screen with no error message and no automatic recovery. Users must manually close and reopen the lesson to resume. A crash recovery mechanism that detects the failure, logs it, and automatically retries playback from the last saved position would significantly improve the lesson completion experience.

Specifications

Features:

  • Video player detects onError and classifies error: network, codec, DRM, unknown
  • Network error: retry 3 times with exponential backoff, then show 'Check connection' message
  • Codec error: attempt fallback quality (360p); if fails, show error with 'Report issue' CTA
  • DRM error: show 'Your subscription may have expired' with settings link
  • All errors reported to Sentry with video URL, codec, position, and device info

Tasks:

  • Add onError handler in MobileVideoPlayer.tsx with error classification
  • Implement retry logic with backoff for network errors
  • Implement quality fallback for codec errors
  • Save last playback position to AsyncStorage on error before retry
  • Add unit test for each error classification path

Impacted Files:

  • src/components/mobile/MobileVideoPlayer.tsx

Acceptance Criteria

  • Network interruption during video triggers automatic retry (max 3 times)
  • After 3 failed retries, user sees network error message with retry button
  • Codec error attempts 360p fallback before showing error
  • DRM error shows specific message with subscription link
  • Sentry receives error event with codec and position context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programbugSomething isn't workingenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions