Class DefaultExtractorsFactory
- java.lang.Object
-
- com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
-
- All Implemented Interfaces:
ExtractorsFactory
@Deprecated public final class DefaultExtractorsFactory extends Object implements ExtractorsFactory
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.AnExtractorsFactorythat provides an array of extractors for the following formats:- MP4, including M4A (
Mp4Extractor) - fMP4 (
FragmentedMp4Extractor) - Matroska and WebM (
MatroskaExtractor) - Ogg Vorbis/FLAC (
OggExtractor - MP3 (
Mp3Extractor) - AAC (
AdtsExtractor) - MPEG TS (
TsExtractor) - MPEG PS (
PsExtractor) - FLV (
FlvExtractor) - WAV (
WavExtractor) - AC3 (
Ac3Extractor) - AC4 (
Ac4Extractor) - AMR (
AmrExtractor) - FLAC
- If available, the FLAC extension's
com.google.android.exoplayer2.ext.flac.FlacExtractoris used. - Otherwise, the core
FlacExtractoris used. Note that Android devices do not generally include a FLAC decoder before API 27. This can be worked around by using the FLAC extension or the FFmpeg extension.
- If available, the FLAC extension's
- JPEG (
JpegExtractor) - MIDI, if available, the MIDI extension's
com.google.android.exoplayer2.decoder.midi.MidiExtractoris used.
-
-
Field Summary
-
Fields inherited from interface com.google.android.exoplayer2.extractor.ExtractorsFactory
EMPTY
-
-
Constructor Summary
Constructors Constructor Description DefaultExtractorsFactory()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Extractor[]createExtractors()Deprecated.Returns an array of newExtractorinstances.Extractor[]createExtractors(Uri uri, Map<String,List<String>> responseHeaders)Deprecated.Returns an array of newExtractorinstances.DefaultExtractorsFactorysetAdtsExtractorFlags(@com.google.android.exoplayer2.extractor.ts.AdtsExtractor.Flags int flags)Deprecated.Sets flags forAdtsExtractorinstances created by the factory.DefaultExtractorsFactorysetAmrExtractorFlags(@com.google.android.exoplayer2.extractor.amr.AmrExtractor.Flags int flags)Deprecated.Sets flags forAmrExtractorinstances created by the factory.DefaultExtractorsFactorysetConstantBitrateSeekingAlwaysEnabled(boolean constantBitrateSeekingAlwaysEnabled)Deprecated.Convenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it, and if it should be enabled even if the content length (and hence the duration of the media) is unknown.DefaultExtractorsFactorysetConstantBitrateSeekingEnabled(boolean constantBitrateSeekingEnabled)Deprecated.Convenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it.DefaultExtractorsFactorysetFlacExtractorFlags(@com.google.android.exoplayer2.extractor.flac.FlacExtractor.Flags int flags)Deprecated.Sets flags forFlacExtractorinstances created by the factory.DefaultExtractorsFactorysetFragmentedMp4ExtractorFlags(@com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor.Flags int flags)Deprecated.Sets flags forFragmentedMp4Extractorinstances created by the factory.DefaultExtractorsFactorysetMatroskaExtractorFlags(@com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.Flags int flags)Deprecated.Sets flags forMatroskaExtractorinstances created by the factory.DefaultExtractorsFactorysetMp3ExtractorFlags(@com.google.android.exoplayer2.extractor.mp3.Mp3Extractor.Flags int flags)Deprecated.Sets flags forMp3Extractorinstances created by the factory.DefaultExtractorsFactorysetMp4ExtractorFlags(@com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.Flags int flags)Deprecated.Sets flags forMp4Extractorinstances created by the factory.DefaultExtractorsFactorysetTsExtractorFlags(@com.google.android.exoplayer2.extractor.ts.DefaultTsPayloadReaderFactory.Flags int flags)Deprecated.Sets flags forDefaultTsPayloadReaderFactorys used byTsExtractorinstances created by the factory.DefaultExtractorsFactorysetTsExtractorMode(@com.google.android.exoplayer2.extractor.ts.TsExtractor.Mode int mode)Deprecated.Sets the mode forTsExtractorinstances created by the factory.DefaultExtractorsFactorysetTsExtractorTimestampSearchBytes(int timestampSearchBytes)Deprecated.Sets the number of bytes searched to find a timestamp forTsExtractorinstances created by the factory.DefaultExtractorsFactorysetTsSubtitleFormats(List<Format> subtitleFormats)Deprecated.Sets a list of subtitle formats to pass to theDefaultTsPayloadReaderFactoryused byTsExtractorinstances created by the factory.
-
-
-
Method Detail
-
setConstantBitrateSeekingEnabled
@CanIgnoreReturnValue public DefaultExtractorsFactory setConstantBitrateSeekingEnabled(boolean constantBitrateSeekingEnabled)
Deprecated.Convenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it. If set to true, the flags required to enable this functionality will be OR'd with those passed to the setters when creating extractor instances. If set to false then the flags passed to the setters will be used without modification.- Parameters:
constantBitrateSeekingEnabled- Whether approximate seeking using a constant bitrate assumption should be enabled for all extractors that support it.- Returns:
- The factory, for convenience.
-
setConstantBitrateSeekingAlwaysEnabled
@CanIgnoreReturnValue public DefaultExtractorsFactory setConstantBitrateSeekingAlwaysEnabled(boolean constantBitrateSeekingAlwaysEnabled)
Deprecated.Convenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it, and if it should be enabled even if the content length (and hence the duration of the media) is unknown. If set to true, the flags required to enable this functionality will be OR'd with those passed to the setters when creating extractor instances. If set to false then the flags passed to the setters will be used without modification.When seeking into content where the length is unknown, application code should ensure that requested seek positions are valid, or should be ready to handle playback failures reported through
Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException)withPlaybackException.errorCodeset toPlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.- Parameters:
constantBitrateSeekingAlwaysEnabled- Whether approximate seeking using a constant bitrate assumption should be enabled for all extractors that support it, including when the content duration is unknown.- Returns:
- The factory, for convenience.
-
setAdtsExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setAdtsExtractorFlags(@com.google.android.exoplayer2.extractor.ts.AdtsExtractor.Flags int flags)
Deprecated.Sets flags forAdtsExtractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
AdtsExtractor(int)
-
setAmrExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setAmrExtractorFlags(@com.google.android.exoplayer2.extractor.amr.AmrExtractor.Flags int flags)
Deprecated.Sets flags forAmrExtractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
AmrExtractor(int)
-
setFlacExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setFlacExtractorFlags(@com.google.android.exoplayer2.extractor.flac.FlacExtractor.Flags int flags)
Deprecated.Sets flags forFlacExtractorinstances created by the factory. The flags are also used bycom.google.android.exoplayer2.ext.flac.FlacExtractorinstances if the FLAC extension is being used.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
FlacExtractor(int)
-
setMatroskaExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setMatroskaExtractorFlags(@com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.Flags int flags)
Deprecated.Sets flags forMatroskaExtractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
MatroskaExtractor(int)
-
setMp4ExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setMp4ExtractorFlags(@com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.Flags int flags)
Deprecated.Sets flags forMp4Extractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
Mp4Extractor(int)
-
setFragmentedMp4ExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setFragmentedMp4ExtractorFlags(@com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor.Flags int flags)
Deprecated.Sets flags forFragmentedMp4Extractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
FragmentedMp4Extractor(int)
-
setMp3ExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setMp3ExtractorFlags(@com.google.android.exoplayer2.extractor.mp3.Mp3Extractor.Flags int flags)
Deprecated.Sets flags forMp3Extractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
Mp3Extractor(int)
-
setTsExtractorMode
@CanIgnoreReturnValue public DefaultExtractorsFactory setTsExtractorMode(@com.google.android.exoplayer2.extractor.ts.TsExtractor.Mode int mode)
Deprecated.Sets the mode forTsExtractorinstances created by the factory.- Parameters:
mode- The mode to use.- Returns:
- The factory, for convenience.
- See Also:
TsExtractor(int, TimestampAdjuster, TsPayloadReader.Factory, int)
-
setTsExtractorFlags
@CanIgnoreReturnValue public DefaultExtractorsFactory setTsExtractorFlags(@com.google.android.exoplayer2.extractor.ts.DefaultTsPayloadReaderFactory.Flags int flags)
Deprecated.Sets flags forDefaultTsPayloadReaderFactorys used byTsExtractorinstances created by the factory.- Parameters:
flags- The flags to use.- Returns:
- The factory, for convenience.
- See Also:
TsExtractor(int)
-
setTsSubtitleFormats
@CanIgnoreReturnValue public DefaultExtractorsFactory setTsSubtitleFormats(List<Format> subtitleFormats)
Deprecated.Sets a list of subtitle formats to pass to theDefaultTsPayloadReaderFactoryused byTsExtractorinstances created by the factory.- Parameters:
subtitleFormats- The subtitle formats.- Returns:
- The factory, for convenience.
- See Also:
DefaultTsPayloadReaderFactory(int, List)
-
setTsExtractorTimestampSearchBytes
@CanIgnoreReturnValue public DefaultExtractorsFactory setTsExtractorTimestampSearchBytes(int timestampSearchBytes)
Deprecated.Sets the number of bytes searched to find a timestamp forTsExtractorinstances created by the factory.- Parameters:
timestampSearchBytes- The number of search bytes to use.- Returns:
- The factory, for convenience.
- See Also:
TsExtractor(int, TimestampAdjuster, TsPayloadReader.Factory, int)
-
createExtractors
public Extractor[] createExtractors()
Deprecated.Description copied from interface:ExtractorsFactoryReturns an array of newExtractorinstances.- Specified by:
createExtractorsin interfaceExtractorsFactory
-
createExtractors
public Extractor[] createExtractors(Uri uri, Map<String,List<String>> responseHeaders)
Deprecated.Description copied from interface:ExtractorsFactoryReturns an array of newExtractorinstances.- Specified by:
createExtractorsin interfaceExtractorsFactory- Parameters:
uri- TheUriof the media to extract.responseHeaders- The response headers of the media to extract, or an empty map if there are none. The map lookup should be case-insensitive.- Returns:
- The
Extractorinstances.
-
-