From ff62189781508ca70e5b298e3155c54e93dfaecc Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Mon, 29 Jul 2024 13:30:45 +0300 Subject: [PATCH] manage the playback state --- .../planet/myplanet/ui/viewer/VideoPlayerActivity.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/viewer/VideoPlayerActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/viewer/VideoPlayerActivity.kt index 7f457b2d5d..06135480d3 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/viewer/VideoPlayerActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/viewer/VideoPlayerActivity.kt @@ -114,6 +114,16 @@ class VideoPlayerActivity : AppCompatActivity(), AuthSessionUpdater.AuthCallback } } + override fun onResume() { + super.onResume() + exoPlayer?.playWhenReady = true + } + + override fun onPause() { + super.onPause() + exoPlayer?.playWhenReady = false + } + override fun onStop() { super.onStop() releasePlayer()