diff options
author | Taco <SkytkRSfan3895@gmail.com> | 2024-03-10 01:59:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 07:59:53 +0100 |
commit | b18e5f0de61bff72a2fc60910418769f7de145e9 (patch) | |
tree | 1cfba4b3823d9630368535844b8e842cd5b0c633 | |
parent | f1fe1b573f71cd8d2d5285ac811884da484d982a (diff) | |
download | AntennaPod-b18e5f0de61bff72a2fc60910418769f7de145e9.zip |
Fix some Media3 deprecations (#6980)
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | core/build.gradle | 7 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java | 8 |
3 files changed, 8 insertions, 9 deletions
diff --git a/build.gradle b/build.gradle index 8261587ef..86eb3655b 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ project.ext { coreVersion = "1.8.0" fragmentVersion = "1.5.5" mediaVersion = "1.6.0" + media3Version = "1.1.1" paletteVersion = "1.0.0" preferenceVersion = "1.1.1" recyclerViewVersion = "1.2.1" @@ -33,7 +34,6 @@ project.ext { rxJavaVersion = "2.2.2" iconifyVersion = "2.2.2" annimonStreamVersion = "1.2.2" - exoPlayerVersion = "1.1.1" // Google Play build wearableSupportVersion = "2.6.0" diff --git a/core/build.gradle b/core/build.gradle index 2aec8e76f..c4cdf28f2 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -48,6 +48,9 @@ dependencies { implementation 'androidx.documentfile:documentfile:1.0.1' implementation "androidx.fragment:fragment:$fragmentVersion" implementation "androidx.media:media:$mediaVersion" + implementation "androidx.media3:media3-datasource-okhttp:$media3Version" + implementation "androidx.media3:media3-exoplayer:$media3Version" + implementation "androidx.media3:media3-ui:$media3Version" implementation "androidx.preference:preference:$preferenceVersion" implementation "androidx.work:work-runtime:$workManagerVersion" implementation "com.google.android.material:material:$googleMaterialVersion" @@ -65,10 +68,6 @@ dependencies { implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion" implementation "com.annimon:stream:$annimonStreamVersion" - implementation "androidx.media3:media3-exoplayer:$exoPlayerVersion" - implementation "androidx.media3:media3-ui:$exoPlayerVersion" - implementation "androidx.media3:media3-datasource-okhttp:$exoPlayerVersion" - // Non-free dependencies: playApi "com.google.android.support:wearable:$wearableSupportVersion" compileOnly "com.google.android.wearable:wearable:$wearableSupportVersion" diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index 565b48f6c..51adbf477 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -13,9 +13,9 @@ import androidx.core.util.Consumer; import androidx.media3.common.C; import androidx.media3.common.PlaybackException; -import androidx.media3.database.ExoDatabaseProvider; +import androidx.media3.database.StandaloneDatabaseProvider; import androidx.media3.datasource.DataSource; -import androidx.media3.datasource.DefaultDataSourceFactory; +import androidx.media3.datasource.DefaultDataSource; import androidx.media3.datasource.HttpDataSource; import androidx.media3.datasource.cache.CacheDataSource; import androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor; @@ -153,7 +153,7 @@ public class ExoPlayerWrapper { } }); simpleCache = new SimpleCache(new File(context.getCacheDir(), "streaming"), - new LeastRecentlyUsedCacheEvictor(50 * 1024 * 1024), new ExoDatabaseProvider(context)); + new LeastRecentlyUsedCacheEvictor(50 * 1024 * 1024), new StandaloneDatabaseProvider(context)); initLoudnessEnhancer(exoPlayer.getAudioSessionId()); } @@ -244,7 +244,7 @@ public class ExoPlayerWrapper { ); httpDataSourceFactory.setDefaultRequestProperties(requestProperties); } - DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context, null, httpDataSourceFactory); + DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(context, httpDataSourceFactory); if (s.startsWith("http")) { dataSourceFactory = new CacheDataSource.Factory() .setCache(simpleCache) |