ResumePositionsStore — SharedPreferences-lite, JSON-blob keyed by videoId. Caps at 500 entries, prunes oldest on add. Skips trivial positions (< 5s) and clears near-end (within 5s of duration) so a finished video doesn't auto-resume to its credits. PlaybackService — 5s polling job + onIsPlayingChanged(false) + onDestroy capture write player position via NowPlaying.streamUrl → videoId. Runs on Main so the player read is thread-safe; store write is SP.apply() async. setPlayingFrom — when caller passes startPositionMs=0L AND Settings.autoResume is on, lookup the saved position and use it. Surface-handoff path (inline ↔ fullscreen) is untouched — MediaController already holds its own position across surfaces. This only fires on fresh opens (cold start, app update, video re-tap from history). |
||
|---|---|---|
| .. | ||
| src/main | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||