Back to Exoplayer

DashUtil (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/dash/DashUtil.html

latest19.0 KB
Original Source

Package com.google.android.exoplayer2.source.dash

Class DashUtil


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDashUtilextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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. Use buildDataSpec(Representation, String, RangedUri, int, Map) instead.

| | static DataSpec | buildDataSpec​(Representation representation, String baseUrl, RangedUri requestUri, int flags) | Deprecated. Use buildDataSpec(Representation, String, RangedUri, int, Map) instead.

| | static DataSpec | buildDataSpec​(Representation representation, String baseUrl, RangedUri requestUri, int flags, Map<String,​String> httpRequestHeaders) | Deprecated.

Builds a DataSpec for a given RangedUri belonging to Representation. | | static ChunkIndex | loadChunkIndex​(DataSource dataSource, int trackType, Representation representation) | Deprecated.

Loads initialization and index data for the representation and returns the ChunkIndex. | | static ChunkIndex | loadChunkIndex​(DataSource dataSource, int trackType, Representation representation, int baseUrlIndex) | Deprecated.

Loads initialization and index data for the representation and returns the ChunkIndex. | | static Format | loadFormatWithDrmInitData​(DataSource dataSource, Period period) | Deprecated.

Loads a Format 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 the representation and optionally index data then returns a BundledChunkExtractor 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 the representation and returns the sample Format. | | static Format | loadSampleFormat​(DataSource dataSource, int trackType, Representation representation, int baseUrlIndex) | Deprecated.

Loads initialization data for the representation and returns the sample Format. | | static String | resolveCacheKey​(Representation representation, RangedUri rangedUri) | Deprecated.

Resolves the cache key to be used when requesting the given ranged URI for the given Representation. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

- 

buildDataSpec

public static[DataSpec](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")buildDataSpec​([Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")baseUrl,[RangedUri](manifest/RangedUri.html "class in com.google.android.exoplayer2.source.dash.manifest")requestUri,
                                     int flags,[Map](https://developer.android.com/reference/java/util/Map.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang"),​[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> httpRequestHeaders)

Deprecated.

Builds a DataSpec for a given RangedUri belonging to Representation. Parameters:representation - The Representation to which the request belongs.baseUrl - The base url with which to resolve the request URI.requestUri - The RangedUri of the data to request.flags - Flags to be set on the returned DataSpec. See DataSpec.Builder.setFlags(int).httpRequestHeaders - The DataSpec.httpRequestHeaders.Returns:The DataSpec.

- 

buildDataSpec

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public static[DataSpec](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")buildDataSpec​([Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")baseUrl,[RangedUri](manifest/RangedUri.html "class in com.google.android.exoplayer2.source.dash.manifest")requestUri,
                                     int flags)

Deprecated. Use buildDataSpec(Representation, String, RangedUri, int, Map) instead.

- 

buildDataSpec

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public static[DataSpec](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")buildDataSpec​([Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,[RangedUri](manifest/RangedUri.html "class in com.google.android.exoplayer2.source.dash.manifest")requestUri,
                                     int flags)

Deprecated. Use buildDataSpec(Representation, String, RangedUri, int, Map) instead.

- 

loadManifest

public static[DashManifest](manifest/DashManifest.html "class in com.google.android.exoplayer2.source.dash.manifest")loadManifest​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri)
                                 throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads a DASH manifest. Parameters:dataSource - The DataSource from which the manifest should be read.uri - The Uri 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](../../Format.html "class in com.google.android.exoplayer2")loadFormatWithDrmInitData​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,[Period](manifest/Period.html "class in com.google.android.exoplayer2.source.dash.manifest")period)
                                        throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads a Format for acquiring keys for a given period in a DASH manifest. Parameters:dataSource - The DataSource from which data should be loaded.period - The Period.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](../../Format.html "class in com.google.android.exoplayer2")loadSampleFormat​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,
                                      int trackType,[Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,
                                      int baseUrlIndex)
                               throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads initialization data for the representation and returns the sample Format. Parameters:dataSource - The source from which the data should be loaded.trackType - The type of the representation. Typically one of the com.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 the list 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](../../Format.html "class in com.google.android.exoplayer2")loadSampleFormat​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,
                                      int trackType,[Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation)
                               throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads initialization data for the representation and returns the sample Format.

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 the com.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](../../extractor/ChunkIndex.html "class in com.google.android.exoplayer2.extractor")loadChunkIndex​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,
                                        int trackType,[Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,
                                        int baseUrlIndex)
                                 throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads initialization and index data for the representation and returns the ChunkIndex. Parameters:dataSource - The source from which the data should be loaded.trackType - The type of the representation. Typically one of the com.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](../../extractor/ChunkIndex.html "class in com.google.android.exoplayer2.extractor")loadChunkIndex​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,
                                        int trackType,[Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation)
                                 throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads initialization and index data for the representation and returns the ChunkIndex.

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 the com.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](../chunk/ChunkExtractor.html "interface in com.google.android.exoplayer2.source.chunk")chunkExtractor,[DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,[Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,
                                          boolean loadIndex)
                                   throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Loads initialization data for the representation and optionally index data then returns a BundledChunkExtractor which contains the output.

Uses the first base URL for loading the initialization data.

Parameters:chunkExtractor - The ChunkExtractor 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](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")resolveCacheKey​([Representation](manifest/Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")representation,[RangedUri](manifest/RangedUri.html "class in com.google.android.exoplayer2.source.dash.manifest")rangedUri)

Deprecated.

Resolves the cache key to be used when requesting the given ranged URI for the given Representation. Parameters:representation - The Representation to which the URI belongs to.rangedUri - The URI for which to resolve the cache key.Returns:The cache key.