diff options
author | ByteHamster <info@bytehamster.com> | 2019-09-25 14:40:18 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-09-25 14:40:18 +0200 |
commit | 96a42b1bbe2005832b552077b8126d635ce9596c (patch) | |
tree | 2c26baa4d102245263ecd6adb9997206e732bbfb | |
parent | f9e7e9aeb67e739f9d72f787a05a083ff81a5dbc (diff) | |
download | AntennaPod-96a42b1bbe2005832b552077b8126d635ce9596c.zip |
Fixed HTTP redirects in ExoPlayer
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java | 10 |
1 files changed, 8 insertions, 2 deletions
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 f20525f73..0fc165183 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 @@ -22,6 +22,8 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; import com.google.android.exoplayer2.trackselection.TrackSelectionArray; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; +import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; +import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; import com.google.android.exoplayer2.util.Util; import org.antennapod.audio.MediaPlayer; @@ -180,8 +182,12 @@ public class ExoPlayerWrapper implements IPlayer { @Override public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException { - DataSource.Factory dataSourceFactory = - new DefaultDataSourceFactory(mContext, Util.getUserAgent(mContext, mContext.getPackageName()), null); + DefaultHttpDataSourceFactory httpDataSourceFactory = new DefaultHttpDataSourceFactory( + Util.getUserAgent(mContext, mContext.getPackageName()), null, + DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS, + DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, + true); + DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(mContext, null, httpDataSourceFactory); ExtractorMediaSource.Factory f = new ExtractorMediaSource.Factory(dataSourceFactory); mediaSource = f.createMediaSource(Uri.parse(s)); } |