use a background thread for setting video surface
This commit is contained in:
parent
be743c1d7f
commit
7b2a181942
1 changed files with 3 additions and 1 deletions
|
@ -506,7 +506,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSurfaceTextureAvailable(surface: SurfaceTexture?, width: Int, height: Int) {
|
override fun onSurfaceTextureAvailable(surface: SurfaceTexture?, width: Int, height: Int) {
|
||||||
|
Thread {
|
||||||
mExoPlayer?.setVideoSurface(Surface(mTextureView!!.surfaceTexture))
|
mExoPlayer?.setVideoSurface(Surface(mTextureView!!.surfaceTexture))
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||||
|
|
Loading…
Reference in a new issue