Class DashUtil
- java.lang.Object
-
- com.google.android.exoplayer2.source.dash.DashUtil
-
@Deprecated public final class DashUtil 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.Utility methods for DASH streams.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DataSpec
buildDataSpec(Representation representation, RangedUri requestUri, int flags)
Deprecated.static DataSpec
buildDataSpec(Representation representation, String baseUrl, RangedUri requestUri, int flags)
Deprecated.static DataSpec
buildDataSpec(Representation representation, String baseUrl, RangedUri requestUri, int flags, Map<String,String> httpRequestHeaders)
Deprecated.static ChunkIndex
loadChunkIndex(DataSource dataSource, int trackType, Representation representation)
Deprecated.Loads initialization and index data for therepresentation
and returns theChunkIndex
.static ChunkIndex
loadChunkIndex(DataSource dataSource, int trackType, Representation representation, int baseUrlIndex)
Deprecated.Loads initialization and index data for therepresentation
and returns theChunkIndex
.static Format
loadFormatWithDrmInitData(DataSource dataSource, Period period)
Deprecated.Loads aFormat
for acquiring keys for a given period in a DASH manifest.static void
loadInitializationData(ChunkExtractor chunkExtractor, DataSource dataSource, Representation representation, boolean loadIndex)
Deprecated.Loads initialization data for therepresentation
and optionally index data then returns aBundledChunkExtractor
which contains the output.static DashManifest
loadManifest(DataSource dataSource, Uri uri)
Deprecated.Loads a DASH manifest.static Format
loadSampleFormat(DataSource dataSource, int trackType, Representation representation)
Deprecated.Loads initialization data for therepresentation
and returns the sampleFormat
.static Format
loadSampleFormat(DataSource dataSource, int trackType, Representation representation, int baseUrlIndex)
Deprecated.Loads initialization data for therepresentation
and returns the sampleFormat
.static String
resolveCacheKey(Representation representation, RangedUri rangedUri)
Deprecated.Resolves the cache key to be used when requesting the given ranged URI for the givenRepresentation
.
-
-
-
Method Detail
-
buildDataSpec
public static DataSpec buildDataSpec(Representation representation, String baseUrl, RangedUri requestUri, int flags, Map<String,String> httpRequestHeaders)
Deprecated.- Parameters:
representation
- TheRepresentation
to which the request belongs.baseUrl
- The base url with which to resolve the request URI.requestUri
- TheRangedUri
of the data to request.flags
- Flags to be set on the returnedDataSpec
. SeeDataSpec.Builder.setFlags(int)
.httpRequestHeaders
- TheDataSpec.httpRequestHeaders
.- Returns:
- The
DataSpec
.
-
buildDataSpec
@Deprecated public static DataSpec buildDataSpec(Representation representation, String baseUrl, RangedUri requestUri, int flags)
Deprecated.
-
buildDataSpec
@Deprecated public static DataSpec buildDataSpec(Representation representation, RangedUri requestUri, int flags)
Deprecated.
-
loadManifest
public static DashManifest loadManifest(DataSource dataSource, Uri uri) throws IOException
Deprecated.Loads a DASH manifest.- Parameters:
dataSource
- TheDataSource
from which the manifest should be read.uri
- TheUri
of the manifest to be read.- Returns:
- An instance of
DashManifest
. - Throws:
IOException
- Thrown when there is an error while loading.
-
loadFormatWithDrmInitData
@Nullable public static Format loadFormatWithDrmInitData(DataSource dataSource, Period period) throws IOException
Deprecated.Loads aFormat
for acquiring keys for a given period in a DASH manifest.- Parameters:
dataSource
- TheDataSource
from which data should be loaded.period
- ThePeriod
.- Returns:
- The loaded
Format
, or null if none is defined. - Throws:
IOException
- Thrown when there is an error while loading.
-
loadSampleFormat
@Nullable public static Format loadSampleFormat(DataSource dataSource, int trackType, Representation representation, int baseUrlIndex) throws IOException
Deprecated.Loads initialization data for therepresentation
and returns the sampleFormat
.- Parameters:
dataSource
- The source from which the data should be loaded.trackType
- The type of the representation. Typically one of thecom.google.android.exoplayer2.C
TRACK_TYPE_*
constants.representation
- The representation which initialization chunk belongs to.baseUrlIndex
- The index of the base URL to be picked from thelist of base URLs
.- Returns:
- the sample
Format
of the given representation. - Throws:
IOException
- Thrown when there is an error while loading.
-
loadSampleFormat
@Nullable public static Format loadSampleFormat(DataSource dataSource, int trackType, Representation representation) throws IOException
Deprecated.Loads initialization data for therepresentation
and returns the sampleFormat
.Uses the first base URL for loading the format.
- Parameters:
dataSource
- The source from which the data should be loaded.trackType
- The type of the representation. Typically one of thecom.google.android.exoplayer2.C
TRACK_TYPE_*
constants.representation
- The representation which initialization chunk belongs to.- Returns:
- the sample
Format
of the given representation. - Throws:
IOException
- Thrown when there is an error while loading.
-
loadChunkIndex
@Nullable public static ChunkIndex loadChunkIndex(DataSource dataSource, int trackType, Representation representation, int baseUrlIndex) throws IOException
Deprecated.Loads initialization and index data for therepresentation
and returns theChunkIndex
.- Parameters:
dataSource
- The source from which the data should be loaded.trackType
- The type of the representation. Typically one of thecom.google.android.exoplayer2.C
TRACK_TYPE_*
constants.representation
- The representation which initialization chunk belongs to.baseUrlIndex
- The index of the base URL with which to resolve the request URI.- Returns:
- The
ChunkIndex
of the given representation, or null if no initialization or index data exists. - Throws:
IOException
- Thrown when there is an error while loading.
-
loadChunkIndex
@Nullable public static ChunkIndex loadChunkIndex(DataSource dataSource, int trackType, Representation representation) throws IOException
Deprecated.Loads initialization and index data for therepresentation
and returns theChunkIndex
.Uses the first base URL for loading the index.
- Parameters:
dataSource
- The source from which the data should be loaded.trackType
- The type of the representation. Typically one of thecom.google.android.exoplayer2.C
TRACK_TYPE_*
constants.representation
- The representation which initialization chunk belongs to.- Returns:
- The
ChunkIndex
of the given representation, or null if no initialization or index data exists. - Throws:
IOException
- Thrown when there is an error while loading.
-
loadInitializationData
public static void loadInitializationData(ChunkExtractor chunkExtractor, DataSource dataSource, Representation representation, boolean loadIndex) throws IOException
Deprecated.Loads initialization data for therepresentation
and optionally index data then returns aBundledChunkExtractor
which contains the output.Uses the first base URL for loading the initialization data.
- Parameters:
chunkExtractor
- TheChunkExtractor
to use.dataSource
- The source from which the data should be loaded.representation
- The representation which initialization chunk belongs to.loadIndex
- Whether to load index data too.- Throws:
IOException
- Thrown when there is an error while loading.
-
resolveCacheKey
public static String resolveCacheKey(Representation representation, RangedUri rangedUri)
Deprecated.Resolves the cache key to be used when requesting the given ranged URI for the givenRepresentation
.- Parameters:
representation
- TheRepresentation
to which the URI belongs to.rangedUri
- The URI for which to resolve the cache key.- Returns:
- The cache key.
-
-