IJK集成播放器,拥有亮度调整、音量调整、视频全屏播放。GitHub
IJKPlayer.arr
android { .... repositories { flatDir { dirs 'libs' } } } dependencies { implementation(name: 'IJKPlayer', ext: 'aar') }
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
dependencies { implementation 'com.github.RelinRan:IJKPlayer:1.0.2' }
<activity android:name=".XXXXX" android:configChanges="keyboardHidden|orientation|screenSize"></activity>
<com.android.ijk.player.view.IJKVideoView android:id="@+id/ijk" android:layout_width="match_parent" android:layout_height="220dp" android:background="@color/colorBlack"></com.android.ijk.player.view.IJKVideoView>
//初始化建议配置在Application IJK.config().initOptions(); IJKVideoView ijk = findViewById(R.id.ijk); //播放视频 ijk.setDataSource("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"); ijk.start();