Merge branch 'master' into develop

This commit is contained in:
ByteHamster 2024-07-27 19:22:28 +02:00
commit d7d783c63c
3 changed files with 8 additions and 13 deletions

View File

@ -12,8 +12,8 @@ android {
// Version code schema:
// "1.2.3-beta4" -> 1020304
// "1.2.3" -> 1020395
versionCode 3040095
versionName "3.4.0"
versionCode 3040195
versionName "3.4.1"
javaCompileOptions {
annotationProcessorOptions {

View File

@ -30,7 +30,6 @@ dependencies {
implementation "androidx.core:core:$coreVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.media:media:$mediaVersion"
implementation "androidx.media3:media3-datasource-okhttp:$media3Version"
implementation "androidx.media3:media3-exoplayer:$media3Version"
implementation "androidx.media3:media3-ui:$media3Version"

View File

@ -18,11 +18,11 @@ import androidx.media3.common.util.UnstableApi;
import androidx.media3.database.StandaloneDatabaseProvider;
import androidx.media3.datasource.DataSource;
import androidx.media3.datasource.DefaultDataSource;
import androidx.media3.datasource.DefaultHttpDataSource;
import androidx.media3.datasource.HttpDataSource;
import androidx.media3.datasource.cache.CacheDataSource;
import androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor;
import androidx.media3.datasource.cache.SimpleCache;
import androidx.media3.datasource.okhttp.OkHttpDataSource;
import androidx.media3.exoplayer.DefaultLoadControl;
import androidx.media3.exoplayer.DefaultRenderersFactory;
import androidx.media3.common.Format;
@ -48,14 +48,12 @@ import de.danoeh.antennapod.net.common.UserAgentInterceptor;
import de.danoeh.antennapod.model.feed.VolumeAdaptionSetting;
import de.danoeh.antennapod.playback.service.R;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.net.common.AntennapodHttpClient;
import de.danoeh.antennapod.net.common.HttpCredentialEncoder;
import de.danoeh.antennapod.net.common.NetworkUtils;
import de.danoeh.antennapod.model.playback.Playable;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import okhttp3.Call;
import java.io.File;
import java.util.ArrayList;
@ -235,16 +233,14 @@ public class ExoPlayerWrapper {
public void setDataSource(String s, String user, String password)
throws IllegalArgumentException, IllegalStateException {
Log.d(TAG, "setDataSource: " + s);
final OkHttpDataSource.Factory httpDataSourceFactory =
new OkHttpDataSource.Factory((Call.Factory) AntennapodHttpClient.getHttpClient())
.setUserAgent(UserAgentInterceptor.USER_AGENT);
final DefaultHttpDataSource.Factory httpDataSourceFactory = new DefaultHttpDataSource.Factory();
httpDataSourceFactory.setUserAgent(UserAgentInterceptor.USER_AGENT);
httpDataSourceFactory.setAllowCrossProtocolRedirects(true);
httpDataSourceFactory.setKeepPostFor302Redirects(true);
if (!TextUtils.isEmpty(user) && !TextUtils.isEmpty(password)) {
final HashMap<String, String> requestProperties = new HashMap<>();
requestProperties.put(
"Authorization",
HttpCredentialEncoder.encode(user, password, "ISO-8859-1")
);
requestProperties.put("Authorization", HttpCredentialEncoder.encode(user, password, "ISO-8859-1"));
httpDataSourceFactory.setDefaultRequestProperties(requestProperties);
}
DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(context, httpDataSourceFactory);