File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/src/main/java/com/pira/ccloud Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -261,27 +261,30 @@ class VideoPlayerActivity : ComponentActivity() {
261261 // Ignore fullscreen errors
262262 }
263263
264- // Resume player when activity resumes
264+ // Player will remain paused until user manually starts it
265265 try {
266266 if (playerInitialized && exoPlayer != null ) {
267- exoPlayer?.playWhenReady = true
267+ // Keep player paused - let user manually start playback
268+ exoPlayer?.playWhenReady = false
268269 }
269270 } catch (e: Exception ) {
270- // Ignore player resume errors
271+ // Ignore player state errors
271272 }
272273 }
273274
274275 override fun onPause () {
275276 super .onPause()
276277 isActivityResumed = false
277278
278- // Pause player when activity pauses
279+ // Stop player completely when activity pauses (app switch or screen off)
279280 try {
280281 if (playerInitialized && exoPlayer != null ) {
281282 exoPlayer?.playWhenReady = false
283+ // Note: currentPosition is managed in the Composable scope
284+ // Player will remain paused until user manually starts it
282285 }
283286 } catch (e: Exception ) {
284- // Ignore player pause errors
287+ // Ignore player stop errors
285288 }
286289 }
287290}
You can’t perform that action at this time.
0 commit comments