mirror of
https://github.com/samsonjs/media.git
synced 2026-04-20 13:45:47 +00:00
Make User-Agent optional
PiperOrigin-RevId: 330593247
This commit is contained in:
parent
6290d093c1
commit
49699d398d
31 changed files with 196 additions and 100 deletions
|
|
@ -139,13 +139,12 @@ public final class MainActivity extends Activity {
|
|||
ACTION_VIEW.equals(action)
|
||||
? Assertions.checkNotNull(intent.getData())
|
||||
: Uri.parse(DEFAULT_MEDIA_URI);
|
||||
String userAgent = Util.getUserAgent(this, getString(R.string.application_name));
|
||||
DrmSessionManager drmSessionManager;
|
||||
if (Util.SDK_INT >= 18 && intent.hasExtra(DRM_SCHEME_EXTRA)) {
|
||||
String drmScheme = Assertions.checkNotNull(intent.getStringExtra(DRM_SCHEME_EXTRA));
|
||||
String drmLicenseUrl = Assertions.checkNotNull(intent.getStringExtra(DRM_LICENSE_URL_EXTRA));
|
||||
UUID drmSchemeUuid = Assertions.checkNotNull(Util.getDrmUuid(drmScheme));
|
||||
HttpDataSource.Factory licenseDataSourceFactory = new DefaultHttpDataSourceFactory(userAgent);
|
||||
HttpDataSource.Factory licenseDataSourceFactory = new DefaultHttpDataSourceFactory();
|
||||
HttpMediaDrmCallback drmCallback =
|
||||
new HttpMediaDrmCallback(drmLicenseUrl, licenseDataSourceFactory);
|
||||
drmSessionManager =
|
||||
|
|
@ -156,9 +155,7 @@ public final class MainActivity extends Activity {
|
|||
drmSessionManager = DrmSessionManager.getDummyDrmSessionManager();
|
||||
}
|
||||
|
||||
DataSource.Factory dataSourceFactory =
|
||||
new DefaultDataSourceFactory(
|
||||
this, Util.getUserAgent(this, getString(R.string.application_name)));
|
||||
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this);
|
||||
MediaSource mediaSource;
|
||||
@C.ContentType int type = Util.inferContentType(uri, intent.getStringExtra(EXTENSION_EXTRA));
|
||||
if (type == C.TYPE_DASH) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
|||
import com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor;
|
||||
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.Executors;
|
||||
|
|
@ -50,7 +49,6 @@ public final class DemoUtil {
|
|||
private static final String DOWNLOAD_TRACKER_ACTION_FILE = "tracked_actions";
|
||||
private static final String DOWNLOAD_CONTENT_DIRECTORY = "downloads";
|
||||
|
||||
private static @MonotonicNonNull String userAgent;
|
||||
private static DataSource.@MonotonicNonNull Factory dataSourceFactory;
|
||||
private static HttpDataSource.@MonotonicNonNull Factory httpDataSourceFactory;
|
||||
private static @MonotonicNonNull DatabaseProvider databaseProvider;
|
||||
|
|
@ -78,23 +76,12 @@ public final class DemoUtil {
|
|||
.setExtensionRendererMode(extensionRendererMode);
|
||||
}
|
||||
|
||||
public static synchronized String getUserAgent(Context context) {
|
||||
if (userAgent == null) {
|
||||
userAgent = Util.getUserAgent(context, "ExoPlayerDemo");
|
||||
}
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public static synchronized HttpDataSource.Factory getHttpDataSourceFactory(Context context) {
|
||||
if (httpDataSourceFactory == null) {
|
||||
context = context.getApplicationContext();
|
||||
CronetEngineWrapper cronetEngineWrapper = new CronetEngineWrapper(context);
|
||||
httpDataSourceFactory =
|
||||
new CronetDataSourceFactory(
|
||||
cronetEngineWrapper,
|
||||
Executors.newSingleThreadExecutor(),
|
||||
/* transferListener= */ null,
|
||||
getUserAgent(context));
|
||||
new CronetDataSourceFactory(cronetEngineWrapper, Executors.newSingleThreadExecutor());
|
||||
}
|
||||
return httpDataSourceFactory;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,6 @@ public class PlayerActivity extends AppCompatActivity
|
|||
DemoUtil.buildRenderersFactory(/* context= */ this, preferExtensionDecoders);
|
||||
MediaSourceFactory mediaSourceFactory =
|
||||
new DefaultMediaSourceFactory(dataSourceFactory)
|
||||
.setDrmUserAgent(DemoUtil.getUserAgent(this))
|
||||
.setAdsLoaderProvider(this::getAdsLoader)
|
||||
.setAdViewProvider(playerView);
|
||||
|
||||
|
|
|
|||
|
|
@ -184,13 +184,12 @@ public final class MainActivity extends Activity {
|
|||
ACTION_VIEW.equals(action)
|
||||
? Assertions.checkNotNull(intent.getData())
|
||||
: Uri.parse(DEFAULT_MEDIA_URI);
|
||||
String userAgent = Util.getUserAgent(this, getString(R.string.application_name));
|
||||
DrmSessionManager drmSessionManager;
|
||||
if (intent.hasExtra(DRM_SCHEME_EXTRA)) {
|
||||
String drmScheme = Assertions.checkNotNull(intent.getStringExtra(DRM_SCHEME_EXTRA));
|
||||
String drmLicenseUrl = Assertions.checkNotNull(intent.getStringExtra(DRM_LICENSE_URL_EXTRA));
|
||||
UUID drmSchemeUuid = Assertions.checkNotNull(Util.getDrmUuid(drmScheme));
|
||||
HttpDataSource.Factory licenseDataSourceFactory = new DefaultHttpDataSourceFactory(userAgent);
|
||||
HttpDataSource.Factory licenseDataSourceFactory = new DefaultHttpDataSourceFactory();
|
||||
HttpMediaDrmCallback drmCallback =
|
||||
new HttpMediaDrmCallback(drmLicenseUrl, licenseDataSourceFactory);
|
||||
drmSessionManager =
|
||||
|
|
@ -201,9 +200,7 @@ public final class MainActivity extends Activity {
|
|||
drmSessionManager = DrmSessionManager.getDummyDrmSessionManager();
|
||||
}
|
||||
|
||||
DataSource.Factory dataSourceFactory =
|
||||
new DefaultDataSourceFactory(
|
||||
this, Util.getUserAgent(this, getString(R.string.application_name)));
|
||||
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this);
|
||||
MediaSource mediaSource;
|
||||
@C.ContentType int type = Util.inferContentType(uri, intent.getStringExtra(EXTENSION_EXTRA));
|
||||
if (type == C.TYPE_DASH) {
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
private volatile long currentConnectTimeoutMs;
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param cronetEngine A CronetEngine.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will handle responses. This may
|
||||
* be a direct executor (i.e. executes tasks on the calling thread) in order to avoid a thread
|
||||
|
|
@ -168,6 +170,8 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param cronetEngine A CronetEngine.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will handle responses. This may
|
||||
* be a direct executor (i.e. executes tasks on the calling thread) in order to avoid a thread
|
||||
|
|
@ -199,6 +203,8 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param cronetEngine A CronetEngine.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will handle responses. This may
|
||||
* be a direct executor (i.e. executes tasks on the calling thread) in order to avoid a thread
|
||||
|
|
@ -233,6 +239,8 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param cronetEngine A CronetEngine.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will handle responses. This may
|
||||
* be a direct executor (i.e. executes tasks on the calling thread) in order to avoid a thread
|
||||
|
|
@ -262,6 +270,8 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param cronetEngine A CronetEngine.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will handle responses. This may
|
||||
* be a direct executor (i.e. executes tasks on the calling thread) in order to avoid a thread
|
||||
|
|
@ -301,6 +311,8 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param cronetEngine A CronetEngine.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will handle responses. This may
|
||||
* be a direct executor (i.e. executes tasks on the calling thread) in order to avoid a thread
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.ext.cronet;
|
||||
|
||||
import static com.google.android.exoplayer2.ExoPlayerLibraryInfo.DEFAULT_USER_AGENT;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
||||
import com.google.android.exoplayer2.upstream.HttpDataSource;
|
||||
|
|
@ -50,7 +52,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
private final HttpDataSource.Factory fallbackFactory;
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, the provided
|
||||
* fallback {@link HttpDataSource.Factory} will be used instead.
|
||||
|
|
@ -79,7 +81,24 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, a {@link
|
||||
* DefaultHttpDataSourceFactory} will be used instead.
|
||||
*
|
||||
* <p>Sets {@link CronetDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the connection timeout,
|
||||
* {@link CronetDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read timeout and disables
|
||||
* cross-protocol redirects.
|
||||
*
|
||||
* @param cronetEngineWrapper A {@link CronetEngineWrapper}.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will perform the requests.
|
||||
*/
|
||||
public CronetDataSourceFactory(CronetEngineWrapper cronetEngineWrapper, Executor executor) {
|
||||
this(cronetEngineWrapper, executor, DEFAULT_USER_AGENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, a {@link
|
||||
* DefaultHttpDataSourceFactory} will be used instead.
|
||||
|
|
@ -93,9 +112,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
* @param userAgent A user agent used to create a fallback HttpDataSource if needed.
|
||||
*/
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
String userAgent) {
|
||||
CronetEngineWrapper cronetEngineWrapper, Executor executor, String userAgent) {
|
||||
this(
|
||||
cronetEngineWrapper,
|
||||
executor,
|
||||
|
|
@ -112,7 +129,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, a {@link
|
||||
* DefaultHttpDataSourceFactory} will be used instead.
|
||||
|
|
@ -147,7 +164,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, the provided
|
||||
* fallback {@link HttpDataSource.Factory} will be used instead.
|
||||
|
|
@ -178,7 +195,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, the provided
|
||||
* fallback {@link HttpDataSource.Factory} will be used instead.
|
||||
|
|
@ -209,7 +226,28 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, a {@link
|
||||
* DefaultHttpDataSourceFactory} will be used instead.
|
||||
*
|
||||
* <p>Sets {@link CronetDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the connection timeout,
|
||||
* {@link CronetDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read timeout and disables
|
||||
* cross-protocol redirects.
|
||||
*
|
||||
* @param cronetEngineWrapper A {@link CronetEngineWrapper}.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will perform the requests.
|
||||
* @param transferListener An optional listener.
|
||||
*/
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@Nullable TransferListener transferListener) {
|
||||
this(cronetEngineWrapper, executor, transferListener, DEFAULT_USER_AGENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, a {@link
|
||||
* DefaultHttpDataSourceFactory} will be used instead.
|
||||
|
|
@ -244,7 +282,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, a {@link
|
||||
* DefaultHttpDataSourceFactory} will be used instead.
|
||||
|
|
@ -277,7 +315,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a CronetDataSourceFactory.
|
||||
* Creates an instance.
|
||||
*
|
||||
* <p>If the {@link CronetEngineWrapper} fails to provide a {@link CronetEngine}, the provided
|
||||
* fallback {@link HttpDataSource.Factory} will be used instead.
|
||||
|
|
|
|||
|
|
@ -46,8 +46,7 @@ public final class FlacExtractorSeekTest {
|
|||
private FlacExtractor extractor = new FlacExtractor();
|
||||
private FakeExtractorOutput extractorOutput = new FakeExtractorOutput();
|
||||
private DefaultDataSource dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
.createDataSource();
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext()).createDataSource();
|
||||
|
||||
@Test
|
||||
public void flacExtractorReads_seekTable_returnSeekableSeekMap() throws IOException {
|
||||
|
|
|
|||
|
|
@ -111,8 +111,7 @@ public class FlacPlaybackTest {
|
|||
player.addListener(this);
|
||||
MediaSource mediaSource =
|
||||
new ProgressiveMediaSource.Factory(
|
||||
new DefaultDataSourceFactory(context, "ExoPlayerExtFlacTest"),
|
||||
MatroskaExtractor.FACTORY)
|
||||
new DefaultDataSourceFactory(context), MatroskaExtractor.FACTORY)
|
||||
.createMediaSource(MediaItem.fromUri(uri));
|
||||
player.setMediaSource(mediaSource);
|
||||
player.prepare();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
|||
import com.google.android.exoplayer2.upstream.DataSource;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
@ -235,13 +234,10 @@ public final class ImaPlaybackTest {
|
|||
@Override
|
||||
protected MediaSource buildSource(
|
||||
HostActivity host,
|
||||
String userAgent,
|
||||
DrmSessionManager drmSessionManager,
|
||||
FrameLayout overlayFrameLayout) {
|
||||
Context context = host.getApplicationContext();
|
||||
DataSource.Factory dataSourceFactory =
|
||||
new DefaultDataSourceFactory(
|
||||
context, Util.getUserAgent(context, ImaPlaybackTest.class.getSimpleName()));
|
||||
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context);
|
||||
MediaSource contentMediaSource =
|
||||
new DefaultMediaSourceFactory(context).createMediaSource(MediaItem.fromUri(contentUri));
|
||||
return new AdsMediaSource(
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import com.google.android.exoplayer2.upstream.DataSource;
|
|||
import com.google.android.exoplayer2.upstream.DataSpec;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -128,8 +127,7 @@ import org.junit.rules.ExternalResource;
|
|||
private final DefaultDataSourceFactory defaultDataSourceFactory;
|
||||
|
||||
public InstrumentingDataSourceFactory(Context context) {
|
||||
defaultDataSourceFactory =
|
||||
new DefaultDataSourceFactory(context, Util.getUserAgent(context, "media2-test"));
|
||||
defaultDataSourceFactory = new DefaultDataSourceFactory(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -81,6 +81,18 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||
private long bytesRead;
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the source.
|
||||
*/
|
||||
public OkHttpDataSource(Call.Factory callFactory) {
|
||||
this(callFactory, ExoPlayerLibraryInfo.DEFAULT_USER_AGENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the source.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
@ -90,6 +102,8 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the source.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
@ -111,6 +125,8 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the source.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
@ -135,6 +151,8 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the source.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.ext.okhttp;
|
||||
|
||||
import static com.google.android.exoplayer2.ExoPlayerLibraryInfo.DEFAULT_USER_AGENT;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.upstream.HttpDataSource;
|
||||
import com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory;
|
||||
|
|
@ -34,6 +36,18 @@ public final class OkHttpDataSourceFactory extends BaseFactory {
|
|||
@Nullable private final CacheControl cacheControl;
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the sources created by the factory.
|
||||
*/
|
||||
public OkHttpDataSourceFactory(Call.Factory callFactory) {
|
||||
this(callFactory, DEFAULT_USER_AGENT, /* listener= */ null, /* cacheControl= */ null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the sources created by the factory.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
@ -43,6 +57,8 @@ public final class OkHttpDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the sources created by the factory.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
@ -54,6 +70,8 @@ public final class OkHttpDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the sources created by the factory.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
@ -65,6 +83,8 @@ public final class OkHttpDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
|
||||
* by the sources created by the factory.
|
||||
* @param userAgent An optional User-Agent string.
|
||||
|
|
|
|||
|
|
@ -92,8 +92,7 @@ public class OpusPlaybackTest {
|
|||
player.addListener(this);
|
||||
MediaSource mediaSource =
|
||||
new ProgressiveMediaSource.Factory(
|
||||
new DefaultDataSourceFactory(context, "ExoPlayerExtOpusTest"),
|
||||
MatroskaExtractor.FACTORY)
|
||||
new DefaultDataSourceFactory(context), MatroskaExtractor.FACTORY)
|
||||
.createMediaSource(MediaItem.fromUri(uri));
|
||||
player.setMediaSource(mediaSource);
|
||||
player.prepare();
|
||||
|
|
|
|||
|
|
@ -121,8 +121,7 @@ public class VpxPlaybackTest {
|
|||
player.addListener(this);
|
||||
MediaSource mediaSource =
|
||||
new ProgressiveMediaSource.Factory(
|
||||
new DefaultDataSourceFactory(context, "ExoPlayerExtVp9Test"),
|
||||
MatroskaExtractor.FACTORY)
|
||||
new DefaultDataSourceFactory(context), MatroskaExtractor.FACTORY)
|
||||
.createMediaSource(MediaItem.fromUri(uri));
|
||||
player
|
||||
.createMessage(videoRenderer)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2;
|
||||
|
||||
import android.os.Build;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
|
|
@ -45,6 +46,10 @@ public final class ExoPlayerLibraryInfo {
|
|||
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
|
||||
public static final int VERSION_INT = 2012000;
|
||||
|
||||
/** The default user agent for requests made by the library. */
|
||||
public static final String DEFAULT_USER_AGENT =
|
||||
VERSION_SLASHY + " (Linux;Android " + Build.VERSION.RELEASE + ") " + VERSION_SLASHY;
|
||||
|
||||
/**
|
||||
* Whether the library was compiled with {@link com.google.android.exoplayer2.util.Assertions}
|
||||
* checks enabled.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import android.net.Uri;
|
|||
import android.util.SparseArray;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.drm.DrmSessionManager;
|
||||
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
|
||||
|
|
@ -115,9 +114,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||
* @param context Any context.
|
||||
*/
|
||||
public DefaultMediaSourceFactory(Context context) {
|
||||
this(
|
||||
new DefaultDataSourceFactory(
|
||||
context, Util.getUserAgent(context, ExoPlayerLibraryInfo.VERSION_SLASHY)));
|
||||
this(new DefaultDataSourceFactory(context));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,12 +15,11 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.source;
|
||||
|
||||
import static com.google.android.exoplayer2.ExoPlayerLibraryInfo.DEFAULT_USER_AGENT;
|
||||
import static com.google.android.exoplayer2.drm.DefaultDrmSessionManager.MODE_PLAYBACK;
|
||||
import static com.google.android.exoplayer2.util.Util.castNonNull;
|
||||
|
||||
import android.os.Build;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.drm.DefaultDrmSessionManager;
|
||||
import com.google.android.exoplayer2.drm.DrmSessionManager;
|
||||
|
|
@ -36,13 +35,6 @@ import java.util.Map;
|
|||
/** A helper to create a {@link DrmSessionManager} from a {@link MediaItem}. */
|
||||
public final class MediaSourceDrmHelper {
|
||||
|
||||
private static final String DEFAULT_USER_AGENT =
|
||||
ExoPlayerLibraryInfo.VERSION_SLASHY
|
||||
+ " (Linux;Android "
|
||||
+ Build.VERSION.RELEASE
|
||||
+ ") "
|
||||
+ ExoPlayerLibraryInfo.VERSION_SLASHY;
|
||||
|
||||
@Nullable private HttpDataSource.Factory drmHttpDataSourceFactory;
|
||||
@Nullable private String userAgent;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package com.google.android.exoplayer2.upstream;
|
|||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
|
|
@ -74,6 +75,20 @@ public final class DefaultDataSource implements DataSource {
|
|||
|
||||
@Nullable private DataSource dataSource;
|
||||
|
||||
/**
|
||||
* Constructs a new instance, optionally configured to follow cross-protocol redirects.
|
||||
*
|
||||
* @param context A context.
|
||||
*/
|
||||
public DefaultDataSource(Context context, boolean allowCrossProtocolRedirects) {
|
||||
this(
|
||||
context,
|
||||
ExoPlayerLibraryInfo.DEFAULT_USER_AGENT,
|
||||
DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
|
||||
DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
|
||||
allowCrossProtocolRedirects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new instance, optionally configured to follow cross-protocol redirects.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.upstream;
|
||||
|
||||
import static com.google.android.exoplayer2.ExoPlayerLibraryInfo.DEFAULT_USER_AGENT;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.upstream.DataSource.Factory;
|
||||
|
|
@ -29,6 +31,11 @@ public final class DefaultDataSourceFactory implements Factory {
|
|||
@Nullable private final TransferListener listener;
|
||||
private final DataSource.Factory baseDataSourceFactory;
|
||||
|
||||
/** @param context A context. */
|
||||
public DefaultDataSourceFactory(Context context) {
|
||||
this(context, DEFAULT_USER_AGENT, /* listener= */ null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context A context.
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import android.text.TextUtils;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
||||
import com.google.android.exoplayer2.upstream.DataSpec.HttpMethod;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.Log;
|
||||
|
|
@ -97,12 +98,26 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||
private long bytesSkipped;
|
||||
private long bytesRead;
|
||||
|
||||
/** @param userAgent The User-Agent string that should be used. */
|
||||
/** Creates an instance. */
|
||||
public DefaultHttpDataSource() {
|
||||
this(
|
||||
ExoPlayerLibraryInfo.DEFAULT_USER_AGENT,
|
||||
DEFAULT_CONNECT_TIMEOUT_MILLIS,
|
||||
DEFAULT_READ_TIMEOUT_MILLIS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
*/
|
||||
public DefaultHttpDataSource(String userAgent) {
|
||||
this(userAgent, DEFAULT_CONNECT_TIMEOUT_MILLIS, DEFAULT_READ_TIMEOUT_MILLIS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
* @param connectTimeoutMillis The connection timeout, in milliseconds. A timeout of zero is
|
||||
* interpreted as an infinite timeout.
|
||||
|
|
@ -119,6 +134,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
* @param connectTimeoutMillis The connection timeout, in milliseconds. A timeout of zero is
|
||||
* interpreted as an infinite timeout. Pass {@link #DEFAULT_CONNECT_TIMEOUT_MILLIS} to use the
|
||||
|
|
@ -146,6 +163,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
||||
* predicate then a {@link HttpDataSource.InvalidContentTypeException} is thrown from {@link
|
||||
|
|
@ -164,6 +183,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
||||
* predicate then a {@link HttpDataSource.InvalidContentTypeException} is thrown from {@link
|
||||
|
|
@ -192,6 +213,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an instance.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
* @param contentTypePredicate An optional {@link Predicate}. If a content type is rejected by the
|
||||
* predicate then a {@link HttpDataSource.InvalidContentTypeException} is thrown from {@link
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.upstream;
|
||||
|
||||
import static com.google.android.exoplayer2.ExoPlayerLibraryInfo.DEFAULT_USER_AGENT;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory;
|
||||
import com.google.android.exoplayer2.upstream.HttpDataSource.Factory;
|
||||
|
|
@ -30,10 +32,18 @@ public final class DefaultHttpDataSourceFactory extends BaseFactory {
|
|||
private final boolean allowCrossProtocolRedirects;
|
||||
|
||||
/**
|
||||
* Constructs a DefaultHttpDataSourceFactory. Sets {@link
|
||||
* DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the connection timeout, {@link
|
||||
* DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read timeout and disables
|
||||
* cross-protocol redirects.
|
||||
* Creates an instance. Sets {@link DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the
|
||||
* connection timeout, {@link DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read
|
||||
* timeout and disables cross-protocol redirects.
|
||||
*/
|
||||
public DefaultHttpDataSourceFactory() {
|
||||
this(DEFAULT_USER_AGENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance. Sets {@link DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the
|
||||
* connection timeout, {@link DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read
|
||||
* timeout and disables cross-protocol redirects.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
*/
|
||||
|
|
@ -42,10 +52,9 @@ public final class DefaultHttpDataSourceFactory extends BaseFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a DefaultHttpDataSourceFactory. Sets {@link
|
||||
* DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the connection timeout, {@link
|
||||
* DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read timeout and disables
|
||||
* cross-protocol redirects.
|
||||
* Creates an instance. Sets {@link DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the
|
||||
* connection timeout, {@link DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read
|
||||
* timeout and disables cross-protocol redirects.
|
||||
*
|
||||
* @param userAgent The User-Agent string that should be used.
|
||||
* @param listener An optional listener.
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ import com.google.android.exoplayer2.upstream.Loader;
|
|||
import com.google.android.exoplayer2.upstream.TransferListener;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
import com.google.android.exoplayer2.util.Clock;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -5552,8 +5551,7 @@ public final class ExoPlayerTest {
|
|||
AdsMediaSource adsMediaSource =
|
||||
new AdsMediaSource(
|
||||
new FakeMediaSource(new FakeTimeline(/* windowCount= */ 1)),
|
||||
new DefaultDataSourceFactory(
|
||||
context, Util.getUserAgent(context, ExoPlayerLibraryInfo.VERSION_SLASHY)),
|
||||
new DefaultDataSourceFactory(context),
|
||||
new FakeAdsLoader(),
|
||||
new FakeAdViewProvider());
|
||||
Exception[] exception = {null};
|
||||
|
|
@ -5590,8 +5588,7 @@ public final class ExoPlayerTest {
|
|||
AdsMediaSource adsMediaSource =
|
||||
new AdsMediaSource(
|
||||
mediaSource,
|
||||
new DefaultDataSourceFactory(
|
||||
context, Util.getUserAgent(context, ExoPlayerLibraryInfo.VERSION_SLASHY)),
|
||||
new DefaultDataSourceFactory(context),
|
||||
new FakeAdsLoader(),
|
||||
new FakeAdViewProvider());
|
||||
final Exception[] exception = {null};
|
||||
|
|
@ -5630,8 +5627,7 @@ public final class ExoPlayerTest {
|
|||
AdsMediaSource adsMediaSource =
|
||||
new AdsMediaSource(
|
||||
mediaSource,
|
||||
new DefaultDataSourceFactory(
|
||||
context, Util.getUserAgent(context, ExoPlayerLibraryInfo.VERSION_SLASHY)),
|
||||
new DefaultDataSourceFactory(context),
|
||||
new FakeAdsLoader(),
|
||||
new FakeAdViewProvider());
|
||||
final Exception[] exception = {null};
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public final class AmrExtractorSeekTest {
|
|||
@Before
|
||||
public void setUp() {
|
||||
dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext())
|
||||
.createDataSource();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,7 @@ public class FlacExtractorSeekTest {
|
|||
private FlacExtractor extractor = new FlacExtractor();
|
||||
private FakeExtractorOutput extractorOutput = new FakeExtractorOutput();
|
||||
private DefaultDataSource dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
.createDataSource();
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext()).createDataSource();
|
||||
|
||||
@Test
|
||||
public void flacExtractorReads_seekTable_returnSeekableSeekMap() throws IOException {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class ConstantBitrateSeekerTest {
|
|||
extractor = new Mp3Extractor();
|
||||
extractorOutput = new FakeExtractorOutput();
|
||||
dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext())
|
||||
.createDataSource();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class IndexSeekerTest {
|
|||
extractor = new Mp3Extractor(FLAG_ENABLE_INDEX_SEEKING);
|
||||
extractorOutput = new FakeExtractorOutput();
|
||||
dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext())
|
||||
.createDataSource();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public final class AdtsExtractorSeekTest {
|
|||
@Before
|
||||
public void setUp() {
|
||||
dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext())
|
||||
.createDataSource();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public final class PsExtractorSeekTest {
|
|||
expectedTrackOutput = expectedOutput.trackOutputs.get(VIDEO_TRACK_ID);
|
||||
|
||||
dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext())
|
||||
.createDataSource();
|
||||
totalInputLength = readInputLength();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public final class TsExtractorSeekTest {
|
|||
.get(AUDIO_TRACK_ID);
|
||||
|
||||
dataSource =
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext(), "UserAgent")
|
||||
new DefaultDataSourceFactory(ApplicationProvider.getApplicationContext())
|
||||
.createDataSource();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -258,12 +258,12 @@ import java.util.List;
|
|||
}
|
||||
|
||||
@Override
|
||||
protected DrmSessionManager buildDrmSessionManager(final String userAgent) {
|
||||
protected DrmSessionManager buildDrmSessionManager() {
|
||||
if (widevineLicenseUrl == null) {
|
||||
return DrmSessionManager.getDummyDrmSessionManager();
|
||||
}
|
||||
MediaDrmCallback drmCallback =
|
||||
new HttpMediaDrmCallback(widevineLicenseUrl, new DefaultHttpDataSourceFactory(userAgent));
|
||||
new HttpMediaDrmCallback(widevineLicenseUrl, new DefaultHttpDataSourceFactory());
|
||||
DefaultDrmSessionManager drmSessionManager =
|
||||
new DefaultDrmSessionManager.Builder()
|
||||
.setUuidAndExoMediaDrmProvider(
|
||||
|
|
@ -301,13 +301,12 @@ import java.util.List;
|
|||
@Override
|
||||
protected MediaSource buildSource(
|
||||
HostActivity host,
|
||||
String userAgent,
|
||||
DrmSessionManager drmSessionManager,
|
||||
FrameLayout overlayFrameLayout) {
|
||||
DataSource.Factory dataSourceFactory =
|
||||
this.dataSourceFactory != null
|
||||
? this.dataSourceFactory
|
||||
: new DefaultDataSourceFactory(host, userAgent);
|
||||
: new DefaultDataSourceFactory(host);
|
||||
return new DashMediaSource.Factory(dataSourceFactory)
|
||||
.setDrmSessionManager(drmSessionManager)
|
||||
.setLoadErrorHandlingPolicy(new DefaultLoadErrorHandlingPolicy(MIN_LOADABLE_RETRY_COUNT))
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
|
|||
this.surface = surface;
|
||||
// Build the player.
|
||||
trackSelector = buildTrackSelector(host);
|
||||
String userAgent = "ExoPlayerPlaybackTests";
|
||||
player = buildExoPlayer(host, surface, trackSelector);
|
||||
player.play();
|
||||
player.addAnalyticsListener(this);
|
||||
|
|
@ -140,10 +139,8 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
|
|||
pendingSchedule.start(player, trackSelector, surface, actionHandler, /* callback= */ null);
|
||||
pendingSchedule = null;
|
||||
}
|
||||
DrmSessionManager drmSessionManager = buildDrmSessionManager(userAgent);
|
||||
player.setMediaSource(
|
||||
buildSource(
|
||||
host, Util.getUserAgent(host, userAgent), drmSessionManager, overlayFrameLayout));
|
||||
DrmSessionManager drmSessionManager = buildDrmSessionManager();
|
||||
player.setMediaSource(buildSource(host, drmSessionManager, overlayFrameLayout));
|
||||
player.prepare();
|
||||
}
|
||||
|
||||
|
|
@ -232,7 +229,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected DrmSessionManager buildDrmSessionManager(String userAgent) {
|
||||
protected DrmSessionManager buildDrmSessionManager() {
|
||||
// Do nothing. Interested subclasses may override.
|
||||
return DrmSessionManager.getDummyDrmSessionManager();
|
||||
}
|
||||
|
|
@ -256,7 +253,6 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
|
|||
|
||||
protected abstract MediaSource buildSource(
|
||||
HostActivity host,
|
||||
String userAgent,
|
||||
DrmSessionManager drmSessionManager,
|
||||
FrameLayout overlayFrameLayout);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue