Package org.schabi.newpipe.extractor
Enum MediaFormat
- java.lang.Object
- 
- java.lang.Enum<MediaFormat>
- 
- org.schabi.newpipe.extractor.MediaFormat
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<MediaFormat>
 
 public enum MediaFormat extends java.lang.Enum<MediaFormat> Static data about various media formats support by NewPipe, eg mime type, extension
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<MediaFormat>getAllFromMimeType(java.lang.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(java.lang.String mimeType)Return the firstMediaFormatwith the supplied mime type.static MediaFormatgetFromSuffix(java.lang.String suffix)Get the first media format that has the given suffix/file extension.static java.lang.StringgetMimeById(int id)Return the MIME type of the media format with the supplied idjava.lang.StringgetMimeType()Get the mime typejava.lang.StringgetName()Get the name of the formatstatic java.lang.StringgetNameById(int id)Return the friendly name of the media format with the supplied idjava.lang.StringgetSuffix()Get the filename extensionstatic java.lang.StringgetSuffixById(int id)Return the file extension of the media format with the supplied idstatic MediaFormatvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MediaFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
 
- 
- 
- 
Enum Constant Detail- 
MPEG_4public static final MediaFormat MPEG_4 
 - 
v3GPPpublic static final MediaFormat v3GPP 
 - 
WEBMpublic static final MediaFormat WEBM 
 - 
M4Apublic static final MediaFormat M4A 
 - 
WEBMApublic static final MediaFormat WEBMA 
 - 
MP3public static final MediaFormat MP3 
 - 
MP2public static final MediaFormat MP2 
 - 
OPUSpublic static final MediaFormat OPUS 
 - 
OGGpublic static final MediaFormat OGG 
 - 
WEBMA_OPUSpublic static final MediaFormat WEBMA_OPUS 
 - 
AIFFpublic static final MediaFormat AIFF 
 - 
AIFpublic static final MediaFormat AIF Same asAIFF, just with the shorter suffix/file extension
 - 
WAVpublic static final MediaFormat WAV 
 - 
FLACpublic static final MediaFormat FLAC 
 - 
ALACpublic static final MediaFormat ALAC 
 - 
VTTpublic static final MediaFormat VTT 
 - 
TTMLpublic static final MediaFormat TTML 
 - 
TRANSCRIPT1public static final MediaFormat TRANSCRIPT1 
 - 
TRANSCRIPT2public static final MediaFormat TRANSCRIPT2 
 - 
TRANSCRIPT3public static final MediaFormat TRANSCRIPT3 
 - 
SRTpublic static final MediaFormat SRT 
 
- 
 - 
Method Detail- 
valuespublic static MediaFormat[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MediaFormat c : MediaFormat.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static MediaFormat valueOf(java.lang.String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
- java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
- java.lang.NullPointerException- if the argument is null
 
 - 
getNameById@Nonnull public static java.lang.String getNameById(int id) 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@Nonnull public static java.lang.String getSuffixById(int id) 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@Nullable public static java.lang.String getMimeById(int id) 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@Nullable public static MediaFormat getFromMimeType(java.lang.String mimeType) 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@Nonnull public static java.util.List<MediaFormat> getAllFromMimeType(java.lang.String mimeType) 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@Nullable public static MediaFormat getFormatById(int id) Get the media format by its id.- Parameters:
- id- the id
- Returns:
- the id of the media format or null.
 
 - 
getFromSuffix@Nullable public static MediaFormat getFromSuffix(java.lang.String suffix) Get the first media format that has the given suffix/file extension.- Returns:
- the matching MediaFormatornullif no associated format is found
 
 - 
getName@Nonnull public java.lang.String getName() Get the name of the format- Returns:
- the name of the format
 
 - 
getSuffix@Nonnull public java.lang.String getSuffix() Get the filename extension- Returns:
- the filename extension
 
 - 
getMimeType@Nonnull public java.lang.String getMimeType() Get the mime type- Returns:
- the mime type
 
 
- 
 
-