Package org.schabi.newpipe.extractor
Enum Class MediaFormat
- All Implemented Interfaces:
Serializable,Comparable<MediaFormat>,Constable
Static data about various media formats support by NewPipe, eg mime type, extension
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic List<MediaFormat>getAllFromMimeType(String mimeType) Get all media formats which have the given mime type.static MediaFormatgetFormatById(int id) Get the media format by its id.static MediaFormatgetFromMimeType(String mimeType) Return the firstMediaFormatwith the supplied mime type.static MediaFormatgetFromSuffix(String suffix) Get the first media format that has the given suffix/file extension.static StringgetMimeById(int id) Return the MIME type of the media format with the supplied idGet the mime typegetName()Get the name of the formatstatic StringgetNameById(int id) Return the friendly name of the media format with the supplied idGet the filename extensionstatic StringgetSuffixById(int id) Return the file extension of the media format with the supplied idstatic MediaFormatReturns the enum constant of this class with the specified name.static MediaFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MPEG_4
-
v3GPP
-
WEBM
-
M4A
-
WEBMA
-
MP3
-
MP2
-
OPUS
-
OGG
-
WEBMA_OPUS
-
AIFF
-
AIF
Same asAIFF, just with the shorter suffix/file extension -
WAV
-
FLAC
-
ALAC
-
VTT
-
TTML
-
TRANSCRIPT1
-
TRANSCRIPT2
-
TRANSCRIPT3
-
SRT
-
-
Field Details
-
id
public final int id -
name
-
suffix
-
mimeType
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getNameById
Return the friendly name of the media format with the supplied id- Parameters:
id- the id of the media format. Currently an arbitrary, NewPipe-specific number.- Returns:
- the friendly name of the MediaFormat associated with this ids, or an empty String if none match it.
-
getSuffixById
Return the file extension of the media format with the supplied id- Parameters:
id- the id of the media format. Currently an arbitrary, NewPipe-specific number.- Returns:
- the file extension of the MediaFormat associated with this ids, or an empty String if none match it.
-
getMimeById
Return the MIME type of the media format with the supplied id- Parameters:
id- the id of the media format. Currently an arbitrary, NewPipe-specific number.- Returns:
- the MIME type of the MediaFormat associated with this ids, or an empty String if none match it.
-
getFromMimeType
Return the firstMediaFormatwith the supplied mime type. There might be more formats which have the same mime type. To retrieve those, usegetAllFromMimeType(String).- Returns:
- MediaFormat associated with this mime type, or null if none match it.
-
getAllFromMimeType
Get all media formats which have the given mime type.- Parameters:
mimeType- the mime type to search for- Returns:
- a modifiable
Listwhich contains theMediaFormats that have the given mime type.
-
getFormatById
Get the media format by its id.- Parameters:
id- the id- Returns:
- the id of the media format or null.
-
getFromSuffix
Get the first media format that has the given suffix/file extension.- Returns:
- the matching
MediaFormatornullif no associated format is found
-
getName
Get the name of the format- Returns:
- the name of the format
-
getSuffix
Get the filename extension- Returns:
- the filename extension
-
getMimeType
Get the mime type- Returns:
- the mime type
-