Commit 3f33800
committed
PR Feedback Refactor MediaPlayerThreadOwner to use MediaPlayer
Remove MediaPlayerFacade and AndroidMediaPlayerFacade and refactor MediaPlayerThreadOwner to depend on android.media.MediaPlayer directly. Introduce PlaybackSnapshot to centralize and atomically update playback state (prepared, duration, position, isPlaying, audioSessionId) instead of multiple volatile cached fields. Update position ticker, player lifecycle, listeners, and ensurePlayer to work with MediaPlayer. Add safe snapshot update helpers and adjust threading/handler logic. VideoView now properly releases the attached Surface via a releaseAttachedSurface() helper to avoid leaks. Tests replaced the FakeMediaPlayerFacade with a createMockMediaPlayer helper using mockk, plus supporting utilities to capture listeners and record thread usage.1 parent aaaec7f commit 3f33800
File tree
5 files changed
+215
-277
lines changed- ui/revenuecatui/src
- main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/video
- test/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/video
5 files changed
+215
-277
lines changedLines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 0 additions & 28 deletions
This file was deleted.
0 commit comments