move mediaplayer releasing back on main thread

This commit is contained in:
tibbi 2017-12-30 09:00:36 +01:00
parent d4d06cf2a7
commit 1b496b5632

View file

@ -467,11 +467,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} }
private fun releaseMediaPlayer() { private fun releaseMediaPlayer() {
Thread {
mMediaPlayer?.setSurface(null) mMediaPlayer?.setSurface(null)
mMediaPlayer?.release() mMediaPlayer?.release()
mMediaPlayer = null mMediaPlayer = null
}.start()
} }
private fun videoPrepared(mediaPlayer: MediaPlayer) { private fun videoPrepared(mediaPlayer: MediaPlayer) {