44 lines
2.3 KiB
Diff
44 lines
2.3 KiB
Diff
diff --git a/node_modules/expo-av/android/build.gradle b/node_modules/expo-av/android/build.gradle
|
|
index e6e3424..f1a6ddc 100644
|
|
--- a/node_modules/expo-av/android/build.gradle
|
|
+++ b/node_modules/expo-av/android/build.gradle
|
|
@@ -113,7 +113,7 @@ android {
|
|
packagingOptions {
|
|
// Gradle will add cmake target dependencies into packaging.
|
|
// Theses files are intermediated linking files to build reanimated and should not be in final package.
|
|
- excludes = [
|
|
+ excludes += [
|
|
"**/libc++_shared.so",
|
|
"**/libreactnativejni.so",
|
|
"**/libglog.so",
|
|
diff --git a/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java b/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java
|
|
index 19818bc..ae4f631 100644
|
|
--- a/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java
|
|
+++ b/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java
|
|
@@ -16,13 +16,21 @@ import okhttp3.OkHttpClient;
|
|
public class SharedCookiesDataSourceFactory implements DataSource.Factory {
|
|
private final DataSource.Factory mDataSourceFactory;
|
|
|
|
+ public static OkHttpClient client;
|
|
+
|
|
+ public static void setOkHttpClient(OkHttpClient okHttpClient) {
|
|
+ client = okHttpClient;
|
|
+ }
|
|
+
|
|
public SharedCookiesDataSourceFactory(Context reactApplicationContext, ModuleRegistry moduleRegistry, String userAgent, Map<String, Object> requestHeaders, TransferListener transferListener) {
|
|
CookieHandler cookieHandler = moduleRegistry.getModule(CookieHandler.class);
|
|
- OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
|
- if (cookieHandler != null) {
|
|
- builder.cookieJar(new JavaNetCookieJar(cookieHandler));
|
|
+ if (this.client == null) {
|
|
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
|
+ if (cookieHandler != null) {
|
|
+ builder.cookieJar(new JavaNetCookieJar(cookieHandler));
|
|
+ }
|
|
+ this.client = builder.build();
|
|
}
|
|
- OkHttpClient client = builder.build();
|
|
mDataSourceFactory = new DefaultDataSourceFactory(reactApplicationContext, transferListener, new CustomHeadersOkHttpDataSourceFactory(client, userAgent, requestHeaders));
|
|
}
|
|
|