Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove exoplayer deprecations and bump Exoplayer #1753

Merged
merged 2 commits into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions android-exoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def safeExtGet(prop, fallback) {
android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -23,18 +23,18 @@ android {

dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation('com.google.android.exoplayer:exoplayer:2.9.3') {
implementation('com.google.android.exoplayer:exoplayer:2.10.4') {
exclude group: 'com.android.support'
}

// All support libs must use the same version
implementation "androidx.annotation:annotation:1.0.0"
implementation "androidx.core:core:1.0.0"
implementation "androidx.media:media:1.0.0"
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.core:core:1.1.0"
implementation "androidx.media:media:1.1.0"

implementation('com.google.android.exoplayer:extension-okhttp:2.9.3') {
implementation('com.google.android.exoplayer:extension-okhttp:2.10.4') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.squareup.okhttp3:okhttp:3.14.3'

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.brentvatne.exoplayer;

import android.content.Context;
import android.content.ContextWrapper;

import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.CookieJarContainer;
import com.facebook.react.modules.network.ForwardingCookieHandler;
Expand All @@ -14,12 +11,10 @@
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.util.Util;

import okhttp3.Cookie;
import okhttp3.JavaNetCookieJar;
import okhttp3.OkHttpClient;
import java.util.Map;


public class DataSourceUtil {

private DataSourceUtil() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.brentvatne.exoplayer;

import android.content.Context;

import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;

public class DefaultReactExoplayerConfig implements ReactExoplayerConfig {

private final DefaultBandwidthMeter bandwidthMeter;

public DefaultReactExoplayerConfig(Context context) {
this.bandwidthMeter = new DefaultBandwidthMeter.Builder(context).build();
}

@Override
public LoadErrorHandlingPolicy buildLoadErrorHandlingPolicy(int minLoadRetryCount) {
return new DefaultLoadErrorHandlingPolicy(minLoadRetryCount);
}

@Override
public DefaultBandwidthMeter getBandwidthMeter() {
return bandwidthMeter;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class RawResourceDataSourceFactory implements DataSource.Factory {

@Override
public DataSource createDataSource() {
return new RawResourceDataSource(context, null);
return new RawResourceDataSource(context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.brentvatne.exoplayer;

import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;

/**
* Extension points to configure the Exoplayer instance
*/
public interface ReactExoplayerConfig {
LoadErrorHandlingPolicy buildLoadErrorHandlingPolicy(int minLoadRetryCount);

DefaultBandwidthMeter getBandwidthMeter();
}
Loading