fix: crash when trying to start audio before playback started

This commit is contained in:
Bnyro 2024-12-05 20:58:50 +01:00
parent 94e848700e
commit 03f95e8983

View File

@ -741,10 +741,12 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
} }
private fun playOnBackground() { private fun playOnBackground() {
val currentPosition = if (::playerController.isInitialized) playerController.currentPosition else 0
BackgroundHelper.playOnBackground( BackgroundHelper.playOnBackground(
requireContext(), requireContext(),
videoId, videoId,
playerController.currentPosition, currentPosition,
playlistId, playlistId,
channelId, channelId,
keepQueue = true, keepQueue = true,