介绍:

UniversalVideoView视频播放初次接触视频的朋友学习

运行效果:

UniversalVideoView视频播放_JAVA

 

UniversalVideoView视频播放_JAVA_02

使用:

  1. add library dependency to your build.gradle file.

dependencies {compile 'com.linsea:universalvideoview:1.1.0@aar'  }
  1. 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