Skip to content

Commit

Permalink
Fix playback from where it was paused
Browse files Browse the repository at this point in the history
  • Loading branch information
tevincent committed Feb 6, 2025
1 parent c9a1dba commit d40e978
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ open class PreviewPlaybackFragment : PreviewFragment() {

override fun onResume() {
super.onResume()
val hasMediaNotStarted = mediaController?.isPlaying == false && mediaController?.currentPosition == 0L
if (!noCurrentFile() && (mediaController == null || hasMediaNotStarted)) {
if (!noCurrentFile() && (mediaController == null || mediaController?.currentPosition == 0L)) {
createPlayer()
} else if (mediaController?.isPlaying == false) {
mediaController?.seekTo(mediaPosition)
}
}

Expand Down

0 comments on commit d40e978

Please sign in to comment.