Skip to content

Commit 3f33800

Browse files
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

5 files changed

+215
-277
lines changed

ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/video/AndroidMediaPlayerFacade.kt

Lines changed: 0 additions & 85 deletions
This file was deleted.

ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/video/MediaPlayerFacade.kt

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)