Class CronetUtil
- java.lang.Object
-
- com.google.android.exoplayer2.ext.cronet.CronetUtil
-
@Deprecated public final class CronetUtil extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Cronet utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static org.chromium.net.CronetEngine
buildCronetEngine(Context context)
Deprecated.Builds aCronetEngine
suitable for use withCronetDataSource
.static org.chromium.net.CronetEngine
buildCronetEngine(Context context, String userAgent, boolean preferGooglePlayServices)
Deprecated.Builds aCronetEngine
suitable for use withCronetDataSource
.
-
-
-
Method Detail
-
buildCronetEngine
@Nullable public static org.chromium.net.CronetEngine buildCronetEngine(Context context)
Deprecated.Builds aCronetEngine
suitable for use withCronetDataSource
. When choosing aCronet provider
to build theCronetEngine
, disabled providers are not considered. Neither are fallback providers, since it's more efficient to useDefaultHttpDataSource
than it is to useCronetDataSource
with a fallbackCronetEngine
.Note that it's recommended for applications to create only one instance of
CronetEngine
, so if your application already has an instance for performing other networking, then that instance should be used and calling this method is unnecessary. See the Android developer guide to learn more about using Cronet for network operations.- Parameters:
context
- A context.- Returns:
- The
CronetEngine
, ornull
if no suitable engine could be built.
-
buildCronetEngine
@Nullable public static org.chromium.net.CronetEngine buildCronetEngine(Context context, @Nullable String userAgent, boolean preferGooglePlayServices)
Deprecated.Builds aCronetEngine
suitable for use withCronetDataSource
. When choosing aCronet provider
to build theCronetEngine
, disabled providers are not considered. Neither are fallback providers, since it's more efficient to useDefaultHttpDataSource
than it is to useCronetDataSource
with a fallbackCronetEngine
.Note that it's recommended for applications to create only one instance of
CronetEngine
, so if your application already has an instance for performing other networking, then that instance should be used and calling this method is unnecessary. See the Android developer guide to learn more about using Cronet for network operations.- Parameters:
context
- A context.userAgent
- A default user agent, ornull
to use a default user agent of theCronetEngine
.preferGooglePlayServices
- Whether Cronet from Google Play Services should be preferred over Cronet Embedded, if both are available.- Returns:
- The
CronetEngine
, ornull
if no suitable engine could be built.
-
-