Create a SignalDataSource class for all of our ExoPlayer needs.

Also fixes an issue around GIF playback within a conversation.
This commit is contained in:
Greyson Parrelli
2021-09-17 09:58:11 -04:00
committed by GitHub
parent 6f6da699a3
commit d5fbd10406
12 changed files with 143 additions and 153 deletions

View File

@@ -15,7 +15,7 @@ import com.google.android.exoplayer2.upstream.DataSource;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.net.ContentProxySelector;
import org.thoughtcrime.securesms.video.exo.ChunkedDataSourceFactory;
import org.thoughtcrime.securesms.video.exo.SignalDataSource;
import okhttp3.OkHttpClient;
@@ -26,7 +26,7 @@ final class GiphyMp4ExoPlayerProvider implements DefaultLifecycleObserver {
private final Context context;
private final OkHttpClient okHttpClient = ApplicationDependencies.getOkHttpClient().newBuilder().proxySelector(new ContentProxySelector()).build();
private final DataSource.Factory dataSourceFactory = new ChunkedDataSourceFactory(okHttpClient, null);
private final DataSource.Factory dataSourceFactory = new SignalDataSource.Factory(ApplicationDependencies.getApplication(), okHttpClient, null);
private final MediaSourceFactory mediaSourceFactory = new ProgressiveMediaSource.Factory(dataSourceFactory);
GiphyMp4ExoPlayerProvider(@NonNull Context context) {