ANDROID FAQ: How can I have smooth video output while scrolling on older Android versions? (Android v4)

Answer: You should use TextureView.


The Android SDK allows developers the ability to use either TextureView or SurfaceView. However, TextureView should be used only if SurfaceView does not meet your needs.

One example is where smooth animations or scrolling of the video surface is required prior to Android N version. In this case, ensure that SDK_INT is less than 24 (Android N), otherwise use SurfaceView. SurfaceView is a default option and you don't need to make any extra configurations.

To use TextureView, use PlayerConfig.Builder() to add the useTextureView(true) to the PlayerConfig object.


// Create a new PlayerConfig using the Builder
PlayerConfig playerConfig = new PlayerConfig.Builder()
			  .useTextureView(true)
			  .build();