use a background thread for releasing exoplayer

This commit is contained in:
tibbi 2018-07-06 11:52:00 +02:00
parent c0e9e931c1
commit 393420ab2d
1 changed files with 4 additions and 2 deletions

View File

@ -456,8 +456,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private fun releaseExoPlayer() {
mExoPlayer?.stop()
mExoPlayer?.release()
mExoPlayer = null
Thread {
mExoPlayer?.release()
mExoPlayer = null
}.start()
}
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {