diff --git a/dependencies.gradle b/dependencies.gradle index da3e0585b39661605b45ff9ec745ec1e5423d314..b5b4161929cd81ea6fa7ab5024b1ee4f446fc8a2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,7 +34,7 @@ ext { gsyVideoVersion = '7.0.1' - exo_player2 = '2.9.6' + exo_player2 = '2.10.0' permissionsdispatcher = '4.3.0' diff --git a/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java b/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java index c86b6f8c9a7fb6ae25dec3a6aa10b87813c88719..27395df2e3e19c43c6f037a35da05af3f60397ce 100644 --- a/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java +++ b/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java @@ -28,6 +28,7 @@ import com.google.android.exoplayer2.upstream.cache.CacheDataSource; import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory; import com.google.android.exoplayer2.upstream.cache.CacheSpan; import com.google.android.exoplayer2.upstream.cache.CacheUtil; +import com.google.android.exoplayer2.upstream.cache.ContentMetadata; import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor; import com.google.android.exoplayer2.upstream.cache.SimpleCache; import com.google.android.exoplayer2.util.Util; @@ -292,7 +293,7 @@ public class ExoSourceManager { if (cachedSpans.size() == 0) { isCache = false; } else { - long contentLength = cache.getContentLength(key); + long contentLength = cache.getContentMetadata(key).get(ContentMetadata.KEY_CONTENT_LENGTH, C.LENGTH_UNSET); long currentLength = 0; for (CacheSpan cachedSpan : cachedSpans) { currentLength += cache.getCachedLength(key, cachedSpan.position, cachedSpan.length); diff --git a/gsyVideoPlayer/build.gradle b/gsyVideoPlayer/build.gradle index 9da0cab075e6680d069196b8a404b0428cd79d2b..01afbc483cc45069284c734d92d68071bd257e25 100644 --- a/gsyVideoPlayer/build.gradle +++ b/gsyVideoPlayer/build.gradle @@ -35,8 +35,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') @@ -48,8 +48,8 @@ dependencies { //api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion" - api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion" - api "com.shuyu:GSYVideoPlayer-exo2:$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"