音乐播放 Ijkplay

首先导入依赖包:

compile'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'

//对应 ijkplayer 的  compile'tv.danmaku.ijk.media:ijkplayer-armv7a:0.6.0'
compile 'com.dou361.ijkplayer-armv7a:jjdxm-ijkplayer-armv7a:1.0.0'
//对应 ijkplayer 的  compile'tv.danmaku.ijk.media:ijkplayer-armv5:0.6.0'
compile 'com.dou361.ijkplayer-armv5:jjdxm-ijkplayer-armv5:1.0.0'
//对应 ijkplayer 的  compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.6.0'
compile 'com.dou361.ijkplayer-arm64:jjdxm-ijkplayer-arm64:1.0.0'
//对应 ijkplayer 的  compile'tv.danmaku.ijk.media:ijkplayer-x86:0.6.0'
compile 'com.dou361.ijkplayer-x86:jjdxm-ijkplayer-x86:1.0.0'
//对应 ijkplayer 的  compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.6.0'
compile 'com.dou361.ijkplayer-x86_64:jjdxm-ijkplayer-x86_64:1.0.0'

 


权限: 

<uses-permission android:name="android.permission.INTERNET">uses-permission>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE">uses-permission>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">usespermission>
<uses-permission android:name="android.permission.WAKE_LOCK" />

 

 

布局:

             android:layout_marginTop="100dp"
        layout="@layout/simple_player_view_player"
        android:layout_width="300dp"
        android:layout_height="300dp" />
代码:

                new PlayerView(MainActivity.this)
                        .setTitle("什么")
                        .setScaleType(PlayStateParams.fitparent)
                        .hideMenu(true)
                        .forbidTouch(false)
                        .setPlaySource(url)
                            .startPlay();
            }

你可能感兴趣的:(音乐播放 Ijkplay)