use a background thread for setting video surface

This commit is contained in:
tibbi 2018-07-24 13:09:14 +02:00
parent be743c1d7f
commit 7b2a181942
1 changed files with 3 additions and 1 deletions

View File

@ -506,7 +506,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
}
override fun onSurfaceTextureAvailable(surface: SurfaceTexture?, width: Int, height: Int) {
mExoPlayer?.setVideoSurface(Surface(mTextureView!!.surfaceTexture))
Thread {
mExoPlayer?.setVideoSurface(Surface(mTextureView!!.surfaceTexture))
}.start()
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)