Class InitializationChunk

  • All Implemented Interfaces:
    Loader.Loadable

    @Deprecated
    public final class InitializationChunk
    extends Chunk
    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.
    A Chunk that uses an Extractor to decode initialization data for single track.
    • Constructor Detail

      • InitializationChunk

        public InitializationChunk​(DataSource dataSource,
                                   DataSpec dataSpec,
                                   Format trackFormat,
                                   @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
                                   @Nullable
                                   Object trackSelectionData,
                                   ChunkExtractor chunkExtractor)
        Deprecated.
        Parameters:
        dataSource - The source from which the data should be loaded.
        dataSpec - Defines the data to be loaded.
        trackFormat - See Chunk.trackFormat.
        trackSelectionReason - See Chunk.trackSelectionReason.
        trackSelectionData - See Chunk.trackSelectionData.
        chunkExtractor - A wrapped extractor to use for parsing the initialization data.
    • Method Detail

      • cancelLoad

        public void cancelLoad()
        Deprecated.
        Description copied from interface: Loader.Loadable
        Cancels the load.

        Loadable implementations should ensure that a currently executing Loader.Loadable.load() call will exit reasonably quickly after this method is called. The Loader.Loadable.load() call may exit either by returning or by throwing an IOException.

        If there is a currently executing Loader.Loadable.load() call, then the thread on which that call is being made will be interrupted immediately after the call to this method. Hence implementations do not need to (and should not attempt to) interrupt the loading thread themselves.

        Although the loading thread will be interrupted, Loadable implementations should not use the interrupted status of the loading thread in Loader.Loadable.load() to determine whether the load has been canceled. This approach is not robust [Internal ref: b/79223737]. Instead, implementations should use their own flag to signal cancelation (for example, using AtomicBoolean).

      • load

        public void load()
                  throws IOException
        Deprecated.
        Description copied from interface: Loader.Loadable
        Performs the load, returning on completion or cancellation.
        Throws:
        IOException - If the input could not be loaded.