介绍:
UniversalVideoView视频播放初次接触视频的朋友学习
运行效果:
使用:
-
add library dependency to your build.gradle file.
dependencies {compile 'com.linsea:universalvideoview:1.1.0@aar' }
-
Include the UniversalVideoView and UniversalMediaController widget in your layout. This should usually be placed in the same parent ViewGroup, which makes sense when in full screen state.
<FrameLayout
android:id="@+id/video_layout"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:background="@android:color/black">
<com.universalvideoview.UniversalVideoView
android:id="@+id/videoView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
app:uvv_autoRotation="true"
app:uvv_fitXY="false" />
<com.universalvideoview.UniversalMediaController
android:id="@+id/media_controller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:uvv_scalable="true" />
</FrameLayout>
https://mp.weixin.qq.com/s/uY1_kl7c1wL6GV14jPUejQ