Skip to content

Commit

Permalink
Check that mediaController has been initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
GrakovNe committed Nov 5, 2024
1 parent bea87f2 commit 6752a6a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ class MediaRepository @Inject constructor(
else -> factor
}

mediaController.setPlaybackSpeed(speed)
_playbackSpeed.postValue(speed)
if (::mediaController.isInitialized) {
mediaController.setPlaybackSpeed(speed)
}

_playbackSpeed.postValue(speed)
preferences.savePlaybackSpeed(speed)
}

Expand Down

0 comments on commit 6752a6a

Please sign in to comment.