diff --git a/README.md b/README.md index 7b4a1ed8..01e626b9 100644 --- a/README.md +++ b/README.md @@ -39,17 +39,17 @@ allprojects { dependencies { # 必选,可兼容市面上绝大部分设备 - implementation 'com.github.dueeeke.dkplayer:dkplayer-java:2.5.4' - implementation 'com.github.dueeeke.dkplayer:dkplayer-armv7a:2.5.4' + implementation 'com.github.dueeeke.dkplayer:dkplayer-java:2.5.5' + implementation 'com.github.dueeeke.dkplayer:dkplayer-armv7a:2.5.5' # 可选,用于兼容一些其他的CPU架构 - implementation 'com.github.dueeeke.dkplayer:dkplayer-armv5:2.5.4' - implementation 'com.github.dueeeke.dkplayer:dkplayer-arm64:2.5.4' - implementation 'com.github.dueeeke.dkplayer:dkplayer-x86:2.5.4' - implementation 'com.github.dueeeke.dkplayer:dkplayer-x86_64:2.5.4' + implementation 'com.github.dueeeke.dkplayer:dkplayer-armv5:2.5.5' + implementation 'com.github.dueeeke.dkplayer:dkplayer-arm64:2.5.5' + implementation 'com.github.dueeeke.dkplayer:dkplayer-x86:2.5.5' + implementation 'com.github.dueeeke.dkplayer:dkplayer-x86_64:2.5.5' # 可选,里面包含StandardVideoController的实现 - implementation 'com.github.dueeeke.dkplayer:dkplayer-ui:2.5.4' + implementation 'com.github.dueeeke.dkplayer:dkplayer-ui:2.5.5' } ``` 或者将library下载并导入项目中使用 diff --git a/app/build.gradle b/app/build.gradle index 290b8712..f9dc6814 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "com.dueeeke.dkplayer" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 28 - versionName "2.5.4" + versionCode 29 + versionName "2.5.5" ndk { //打包时保留armeabi-v7a x86 so @@ -79,10 +79,9 @@ dependencies { implementation 'com.github.ctiao:DanmakuFlameMaster:0.8.3' implementation 'com.github.ctiao:ndkbitmap-armv7a:0.8.3' implementation "com.android.support:design:$rootProject.supportLibraryVersion" - implementation 'com.github.rubensousa:gravitysnaphelper:1.5' implementation 'com.google.android.exoplayer:exoplayer:2.8.2' implementation 'com.google.android.exoplayer:extension-rtmp:2.8.2' - + //缓存 implementation 'com.danikula:videocache:2.7.1' diff --git a/app/src/main/java/com/dueeeke/dkplayer/widget/videoview/CacheIjkVideoView.java b/app/src/main/java/com/dueeeke/dkplayer/widget/videoview/CacheIjkVideoView.java index ddcd3c4b..9900845e 100644 --- a/app/src/main/java/com/dueeeke/dkplayer/widget/videoview/CacheIjkVideoView.java +++ b/app/src/main/java/com/dueeeke/dkplayer/widget/videoview/CacheIjkVideoView.java @@ -67,11 +67,11 @@ public void setCacheEnabled(boolean isEnabled) { } /** - * 返回是缓存的进度 + * 开启缓存后,返回是缓存的进度 */ @Override public int getBufferedPercentage() { - return mBufferedPercentage; + return mIsCacheEnabled ? mBufferedPercentage : super.getBufferedPercentage(); } @Override diff --git a/app/src/main/res/layout/activity_cache.xml b/app/src/main/res/layout/activity_cache.xml index ee8855d6..d9627e54 100644 --- a/app/src/main/res/layout/activity_cache.xml +++ b/app/src/main/res/layout/activity_cache.xml @@ -6,6 +6,6 @@ + android:layout_height="250dp"/> \ No newline at end of file