Rendering and playing the video in the form of gif in Android will greatly improve the response efficiency of your application. For example, playing multiple video files in the recyclerview at the same time will not cause sliding and freezing. It will be easy to use gifvideo.You can download and install gifvideo demo here
Add dependencies in build.gradle
implementation 'com.ben.android:gifvideo:$VERSION'
VideoView videoView = new VideoView(context);
//set auto play
videoView.setAutoPlay(true) //default true
//set filepath
videoView.setPath(path);
//start play
videoView.start();
//you can also control the pause or play by yourself
//videoView.start();
//videoView.stop();
//Remember to release resources
videoView.recycle();