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: // Version code schema:
// "1.2.3-beta4" -> 1020304 // "1.2.3-beta4" -> 1020304
// "1.2.3" -> 1020395 // "1.2.3" -> 1020395
versionCode 3040095 versionCode 3040195
versionName "3.4.0" versionName "3.4.1"
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {

View File

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