Pausing during buffering does nothing — playback can resume in the background after leaving the app #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
PlayerController.pause()(PlayerController.kt:97) andtoggle()(PlayerController.kt:93) both gate onplayer.isPlaying. In Media3isPlayingisfalsewhileplaybackState == STATE_BUFFERING, even withplayWhenReady == true. So during a rebuffer:pause()is a no-op —playWhenReadystaystruetoggle()takes theelsebranch and callsresume()instead of pausingMainActivity.onStop()callsstate.player.pause()with the comment "TV-NP: video must not keep playing when the user leaves the app" — but on the buffering path that call does nothing.Failure scenario
The stream stalls to rebuffer, the user presses Home.
pause()no-ops,playWhenReadyremainstrue, buffering completes in the background and audio starts playing behind the launcher. This is exactly the behaviour the TV app quality guideline (TV-NP) forbids, and it burns a provider connection while nobody is watching.The remote's pause button hits the same dead path whenever it is pressed during a stall.
Suggested fix
Set the intent unconditionally instead of inspecting
isPlaying:Found by multi-agent code review; verified against current
PlayerController.ktandMainActivity.kt.Fixed in
dd612fc, shipped in v0.9.0.Both methods now act on the intent flag instead of the derived
isPlaying:playWhenReadyistrueduring buffering, so pausing mid-stall now actually pauses,toggle()no longer flips the wrong way, andonStop()reliably stops playback when the viewer leaves the app — no more audio continuing behind the launcher after a rebuffer.