Skip to content

Commit 6e1a85a

Browse files
committed
Make sure to call stopMotionPhotoVideo() only in ui thread
1 parent 9dbcfae commit 6e1a85a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/kotlin/org/fossify/gallery/fragments/PhotoFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ class PhotoFragment : ViewPagerFragment() {
964964
addListener(object : Player.Listener {
965965
override fun onPlaybackStateChanged(playbackState: Int) {
966966
if (playbackState == Player.STATE_ENDED) {
967-
stopMotionPhotoVideo()
967+
activity?.runOnUiThread { stopMotionPhotoVideo() }
968968
}
969969
}
970970

@@ -980,7 +980,7 @@ class PhotoFragment : ViewPagerFragment() {
980980
}
981981

982982
override fun onPlayerError(error: PlaybackException) {
983-
stopMotionPhotoVideo()
983+
activity?.runOnUiThread { stopMotionPhotoVideo() }
984984
}
985985
})
986986
}

0 commit comments

Comments
 (0)