Author: Lin Guanhong/Ghost under the fingertips
Nuggets: https://juejin.im/user/587f0dfe128fe100570ce2d8
Blog: http://www.cnblogs.com/linguanh/
GitHub: https://github.com/af913337456/
For your intuitive experience, please be sure to read the gif below, the source code gitHub link is after it.
In order to avoid everyone wasting time, just look at the Gif below. It is slightly larger, so please be patient. After reading this, if you think you need it, then please listen to me and continue.
The gif demo is too large and cannot be displayed on github. To watch the video link, you can go to the article: https://juejin.im/post/59006c76a0bb9f0065dbc835
repositories {
jcenter ()
maven { url "https://jitpack.io" }
}
compile 'com.github.af913337456:WeChatVideoView:1.0'
If you read the above gif, you will find the following functions (Function list):
1. Intuitive
2. Hidden
The intuitive function points are almost the same as the new version of微信
. Click on a video from the circle of friends, and then enter an Activity page to load and play.
Because SurfaceView is used instead of TextureView, the switching delay between image and video is also due to this reason.
In this way, the Relativelayout with the id activity_main will be loaded as the parent container. Because you want to avoid memory leaks, you also need to complete the following steps, which will not exceed 6 lines of code.