From e686ae6cdc8500361e27f21786a9ab170103c1cb Mon Sep 17 00:00:00 2001 From: guoshuyu Date: Wed, 22 Aug 2018 14:44:31 +0800 Subject: [PATCH] 6.0.0-beta --- README.md | 4 +-- app/build.gradle | 4 +-- dependencies.gradle | 2 +- doc/DEPENDENCIES.md | 4 +-- doc/FURTURE.md | 4 +++ doc/USE.md | 36 ++++++++++++++++++++----- gsyVideoPlayer-exo_player2/build.gradle | 10 +++---- gsyVideoPlayer-java/build.gradle | 10 +++---- gsyVideoPlayer/build.gradle | 21 ++++++++------- 9 files changed, 60 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 4fafb1765..9bb1a8115 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ implementation 'com.shuyu:GSYVideoPlayer:6.0.0-beta' implementation 'com.shuyu:gsyVideoPlayer-java:6.0.0-beta' //是否需要ExoPlayer模式 -implementation 'com.shuyu:gsyVideoPlayer-exo2:6.0.0-beta' +implementation 'com.shuyu:GSYVideoPlayer-exo2:6.0.0-beta' //根据你的需求ijk模式的so implementation 'com.shuyu:gsyVideoPlayer-armv5:6.0.0-beta' @@ -75,7 +75,7 @@ C 引入的so支持mpeg编码和其他补充协议,但是so包相对变大。 implementation 'com.shuyu:gsyVideoPlayer-java:6.0.0-beta' //是否需要ExoPlayer模式 -implementation 'com.shuyu:gsyVideoPlayer-exo2:6.0.0-beta' +implementation 'com.shuyu:GSYVideoPlayer-exo2:6.0.0-beta' //更多ijk的编码支持 implementation 'com.shuyu:gsyVideoPlayer-ex_so:6.0.0-beta' diff --git a/app/build.gradle b/app/build.gradle index b0e03775c..158202a9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -76,7 +76,7 @@ dependencies { implementation androidDependencies.support_v4 implementation androidDependencies.design - implementation project(':gsyVideoPlayer') + //implementation project(':gsyVideoPlayer') implementation dataDependencies.okhttpUtil implementation dataDependencies.okhttp @@ -89,7 +89,7 @@ dependencies { //jcenter - //implementation "com.shuyu:GSYVideoPlayer:$gsyVideoVersion" + implementation "com.shuyu:GSYVideoPlayer:$gsyVideoVersion" //implementation "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion' diff --git a/dependencies.gradle b/dependencies.gradle index f3e3fbae6..2495ac2a7 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -29,7 +29,7 @@ ext { imageLoader = '4.0.0' - gsyVideoVersion = '5.0.2' + gsyVideoVersion = '6.0.0-beta' exo_player2 = '2.8.4' diff --git a/doc/DEPENDENCIES.md b/doc/DEPENDENCIES.md index 015582f17..be87a27aa 100644 --- a/doc/DEPENDENCIES.md +++ b/doc/DEPENDENCIES.md @@ -17,7 +17,7 @@ implementation 'com.shuyu:GSYVideoPlayer:6.0.0-beta' implementation 'com.shuyu:gsyVideoPlayer-java:6.0.0-beta' //是否需要ExoPlayer模式 -implementation 'com.shuyu:gsyVideoPlayer-exo2:6.0.0-beta' +implementation 'com.shuyu:GSYVideoPlayer-exo2:6.0.0-beta' //根据你的需求ijk模式的so implementation 'com.shuyu:gsyVideoPlayer-armv5:6.0.0-beta' @@ -37,7 +37,7 @@ C 引入的so支持mpeg编码和其他补充协议,但是so包相对变大。 implementation 'com.shuyu:gsyVideoPlayer-java:6.0.0-beta' //是否需要ExoPlayer模式 -implementation 'com.shuyu:gsyVideoPlayer-exo2:6.0.0-beta' +implementation 'com.shuyu:GSYVideoPlayer-exo2:6.0.0-beta' //更多ijk的编码支持 implementation 'com.shuyu:gsyVideoPlayer-ex_so:6.0.0-beta' diff --git a/doc/FURTURE.md b/doc/FURTURE.md index 1fa2e1b5d..0703e4f06 100644 --- a/doc/FURTURE.md +++ b/doc/FURTURE.md @@ -1,2 +1,6 @@ 1、精简库依赖,提供按需依赖载入 + +2、拆分缓存框架 + +3、拆分绘制surface框架,增加SurfaceFactory \ No newline at end of file diff --git a/doc/USE.md b/doc/USE.md index b7a70de6e..239394605 100644 --- a/doc/USE.md +++ b/doc/USE.md @@ -460,16 +460,40 @@ public void onConfigurationChanged(Configuration newConfig) { (以下设置全局生效哦) #### 切换内核 +``` +//PlayerFactory.setPlayManager(new Exo2PlayerManager());//EXO模式 +//PlayerFactory.setPlayManager(new SystemPlayerManager());//系统模式 +//PlayerFactory.setPlayManager(new IjkPlayerManager());//ijk模式 ``` - //默认ijk播放内核 - GSYVideoManager.instance().setVideoType(this, GSYVideoType.IJKPLAYER); - //EXO 2 播放内核 - GSYVideoManager.instance().setVideoType(this, GSYVideoType.IJKEXOPLAYER2); - //系统播放器 - GSYVideoManager.instance().setVideoType(this, GSYVideoType.SYSTEMPLAYER); +#### 调整代码结构,CacheFactory 更方便自定义,默认 ProxyCacheManager。 + +``` +//CacheFactory.setCacheManager(new ExoPlayerCacheManager());//exo缓存模式,支持m3u8,只支持exo +//CacheFactory.setCacheManager(new ProxyCacheManager());//代理缓存模式,支持所有模式,不支持m3u8等 ``` +#### 增加 ExoMediaSourceInterceptListener,方便 Exo 模式下使用自定义的 MediaSource。 + +``` +ExoSourceManager.setExoMediaSourceInterceptListener(new ExoMediaSourceInterceptListener() { + /** + * @param dataSource 链接 + * @param preview 是否带上header,默认有header自动设置为true + * @param cacheEnable 是否需要缓存 + * @param isLooping 是否循环 + * @param cacheDir 自定义缓存目录 + * @return 返回不为空时,使用返回的自定义mediaSource + */ + @Override + public MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir) { + return null; + } +}); +``` + + + #### 切换比例 ``` diff --git a/gsyVideoPlayer-exo_player2/build.gradle b/gsyVideoPlayer-exo_player2/build.gradle index 73e465657..ec6bc4d14 100644 --- a/gsyVideoPlayer-exo_player2/build.gradle +++ b/gsyVideoPlayer-exo_player2/build.gradle @@ -31,20 +31,16 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) def viewDependencies = rootProject.ext.viewDependencies - api viewDependencies.ijkplayer_java - api viewDependencies.exo_player2 api viewDependencies.exo_player2_rtmp - - //api "com.shuyu:GSYVideoPlayer-base:$gsyVideoVersion" - api project(':gsyVideoPlayer-base') + //api project(':gsyVideoPlayer-base') + api "com.shuyu:gsyVideoPlayer-base:$gsyVideoVersion" //compile fileTree(dir: 'libs', include: ['*.jar']) //def viewDependencies = rootProject.ext.viewDependencies - //compile viewDependencies.ijkplayer_java //compile viewDependencies.exo_player2 //compile viewDependencies.exo_player2_rtmp - //compile "com.shuyu:GSYVideoPlayer-base:$gsyVideoVersion" + //compile "com.shuyu:gsyVideoPlayer-base:6.0.0-beta" } diff --git a/gsyVideoPlayer-java/build.gradle b/gsyVideoPlayer-java/build.gradle index b818467bd..bc2adeb9b 100644 --- a/gsyVideoPlayer-java/build.gradle +++ b/gsyVideoPlayer-java/build.gradle @@ -36,10 +36,10 @@ dependencies { api viewDependencies.ijkplayer_java api viewDependencies.ijkplayer_exo api viewDependencies.transitionseverywhere - //api dataDependencies.videocache - //api "com.shuyu:GSYVideoPlayer-base:$gsyVideoVersion" - api project(':gsyVideoPlayer-proxy_cache') - api project(':gsyVideoPlayer-base') + //api project(':gsyVideoPlayer-proxy_cache') + //api project(':gsyVideoPlayer-base') + api "com.shuyu:gsyVideoPlayer-base:$gsyVideoVersion" + api "com.shuyu:gsyvideoplayer-androidvideocache:$gsyVideoVersion" // compile fileTree(dir: 'libs', include: ['*.jar']) @@ -48,7 +48,7 @@ dependencies { // compile viewDependencies.ijkplayer_java // compile viewDependencies.transitionseverywhere // compile "com.shuyu:gsyvideoplayer-androidvideocache:$gsyVideoVersion" -// compile "com.shuyu:GSYVideoPlayer-base:$gsyVideoVersion" +// compile "com.shuyu:gsyVideoPlayer-base:$gsyVideoVersion" } diff --git a/gsyVideoPlayer/build.gradle b/gsyVideoPlayer/build.gradle index de3cc412a..c32ac6d23 100644 --- a/gsyVideoPlayer/build.gradle +++ b/gsyVideoPlayer/build.gradle @@ -31,8 +31,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - api project(':gsyVideoPlayer-java') - api project(':gsyVideoPlayer-exo_player2') + //api project(':gsyVideoPlayer-java') + //api project(':gsyVideoPlayer-exo_player2') //api project(':gsyVideoPlayer-armv5') //api project(':gsyVideoPlayer-armv7a') //api project(':gsyVideoPlayer-armv64') @@ -44,20 +44,21 @@ dependencies { //api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion" - //api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion" - //api "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion" - //api "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion" - //api "com.shuyu:gsyVideoPlayer-arm64:$gsyVideoVersion" - //api "com.shuyu:gsyVideoPlayer-x64:$gsyVideoVersion" - //api "com.shuyu:gsyVideoPlayer-x86:$gsyVideoVersion" + api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion" + api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion" + api "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion" + api "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion" + api "com.shuyu:gsyVideoPlayer-arm64:$gsyVideoVersion" + api "com.shuyu:gsyVideoPlayer-x64:$gsyVideoVersion" + api "com.shuyu:gsyVideoPlayer-x86:$gsyVideoVersion" //更多配置版so,增加了concat,rtsp,mpeg,crypto - api "com.shuyu:gsyVideoPlayer-ex_so:$gsyVideoVersion" + //api "com.shuyu:gsyVideoPlayer-ex_so:$gsyVideoVersion" //compile fileTree(dir: 'libs', include: ['*.jar']) //compile "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion" - //compile "com.shuyu:gsyVideoPlayer-exo2:$gsyVideoVersion" + //compile "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion" //compile "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion" //compile "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion" //compile "com.shuyu:gsyVideoPlayer-arm64:$gsyVideoVersion"