- Notifications
You must be signed in to change notification settings - Fork437
The basic library of Android player will process complex business components. The access is simple。Android播放器基础库,专注于播放视图组件的高复用性和组件间的低耦合,轻松处理复杂业务。
License
NotificationsYou must be signed in to change notification settings
jiajunhui/PlayerBase
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
博文地址 :Android播放器基础封装库PlayerBase
需要的权限,如果targetSDK版本在Android M以上的,请注意运行时权限的处理。
<uses-permissionandroid:name="android.permission.INTERNET"/><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/>
dependencies {//该依赖仅包含MediaPlayer解码 implementation'com.kk.taurus.playerbase:playerbase:3.4.2' }
dependencies {//该依赖包含exoplayer解码和MediaPlayer解码//注意exoplayer的最小支持SDK版本为16 implementation'cn.jiajunhui:exoplayer:342_2132_019' }
dependencies {//该依赖包含ijkplayer解码和MediaPlayer解码 implementation'cn.jiajunhui:ijkplayer:342_088_012'//ijk官方的解码库依赖,较少格式版本且不支持HTTPS。 implementation'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8' #OtherABIs: optional implementation'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8' implementation'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8' implementation'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8' implementation'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8' }
dependencies {//该依赖包含exoplayer解码和MediaPlayer解码//注意exoplayer的最小支持SDK版本为16 implementation'cn.jiajunhui:exoplayer:342_2132_019'//该依赖包含ijkplayer解码和MediaPlayer解码 implementation'cn.jiajunhui:ijkplayer:342_088_012'//ijk官方的解码库依赖,较少格式版本且不支持HTTPS。 implementation'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8' #OtherABIs: optional implementation'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8' implementation'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8' implementation'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8' implementation'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8' }
如果您添加依赖exoplayer的库,需要在gradle中增加如下配置。
buildTypes {//... compileOptions{ targetCompatibilityJavaVersion.VERSION_1_8 }}
代码混淆时,请在proguard中添加如下保护
-keep public class * extends android.view.View{*;}-keep public class * implements com.kk.taurus.playerbase.player.IPlayer{*;}
初始化
publicclassAppextendsApplication {@OverridepublicvoidonCreate() {//...//如果您想使用默认的网络状态事件生产者,请添加此行配置。//并需要添加权限 android.permission.ACCESS_NETWORK_STATEPlayerConfig.setUseDefaultNetworkEventProducer(true);//初始化库PlayerLibrary.init(this);//-------------------------------------------//如果添加了'cn.jiajunhui:exoplayer:xxxx'该依赖ExoMediaPlayer.init(this);//如果添加了'cn.jiajunhui:ijkplayer:xxxx'该依赖IjkPlayer.init(this);//播放记录的配置//开启播放记录PlayerConfig.playRecord(true);PlayRecordManager.setRecordConfig(newPlayRecordManager.RecordConfig.Builder() .setMaxRecordCount(100)//.setRecordKeyProvider()//.setOnRecordCallBack() .build()); } }
联系方式:junhui_jia@163.com
QQ群:600201778
Copyright 2017 jiajunhui<junhui_jia@163.com>Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
About
The basic library of Android player will process complex business components. The access is simple。Android播放器基础库,专注于播放视图组件的高复用性和组件间的低耦合,轻松处理复杂业务。
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published