fix: retain exoplayer on orientation change (#6428)

This commit is contained in:
Thomas W. 2024-09-05 11:01:50 +02:00 committed by GitHub
parent 8bd684038c
commit 5bd6cc7c44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -845,12 +845,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
viewModel.player.removeListener(playerListener)
viewModel.player.pause()
runCatching {
if (!viewModel.isOrientationChangeInProgress) {
viewModel.player.stop()
}
}
if (PlayerHelper.pipEnabled) {
// disable the auto PiP mode for SDK >= 32
PictureInPictureCompat
@ -1347,11 +1341,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
}
private fun createExoPlayer() {
// viewModel.keepOrCreatePlayer(requireContext()).let { (player, trackSelector) ->
// localViewModel.player = player
// localViewModel.trackSelector = trackSelector
// }
viewModel.player.setWakeMode(C.WAKE_MODE_NETWORK)
viewModel.player.addListener(playerListener)