Fix some Media3 deprecations (#6980)
This commit is contained in:
parent
f1fe1b573f
commit
b18e5f0de6
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue