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

View file

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