Class IcyHeaders
- java.lang.Object
-
- com.google.android.exoplayer2.metadata.icy.IcyHeaders
-
- All Implemented Interfaces:
Parcelable,Metadata.Entry
public final class IcyHeaders extends Object implements Metadata.Entry
ICY headers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description intbitrateBitrate in bits per second ((icy-br * 1000)), orFormat.NO_VALUEif the header was not present.static Parcelable.Creator<IcyHeaders>CREATORStringgenreThe genre (icy-genre).booleanisPublicWhether the radio station is listed (icy-pub), orfalseif the header was not present.intmetadataIntervalThe interval in bytes between metadata chunks (icy-metaint), orC.LENGTH_UNSETif the header was not present.StringnameThe stream name (icy-name).static StringREQUEST_HEADER_ENABLE_METADATA_NAMEstatic StringREQUEST_HEADER_ENABLE_METADATA_VALUEStringurlThe URL of the radio station (icy-url).-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Constructor Description IcyHeaders(int bitrate, String genre, String name, String url, boolean isPublic, int metadataInterval)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object obj)inthashCode()static IcyHeadersparse(Map<String,List<String>> responseHeaders)ParsesIcyHeadersfrom response headers.voidpopulateMediaMetadata(MediaMetadata.Builder builder)Updates theMediaMetadata.Builderwith the type specific values stored in this Entry.StringtoString()voidwriteToParcel(Parcel dest, int flags)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.metadata.Metadata.Entry
getWrappedMetadataBytes, getWrappedMetadataFormat
-
-
-
-
Field Detail
-
REQUEST_HEADER_ENABLE_METADATA_NAME
public static final String REQUEST_HEADER_ENABLE_METADATA_NAME
- See Also:
- Constant Field Values
-
REQUEST_HEADER_ENABLE_METADATA_VALUE
public static final String REQUEST_HEADER_ENABLE_METADATA_VALUE
- See Also:
- Constant Field Values
-
bitrate
public final int bitrate
Bitrate in bits per second ((icy-br * 1000)), orFormat.NO_VALUEif the header was not present.
-
genre
@Nullable public final String genre
The genre (icy-genre).
-
name
@Nullable public final String name
The stream name (icy-name).
-
url
@Nullable public final String url
The URL of the radio station (icy-url).
-
isPublic
public final boolean isPublic
Whether the radio station is listed (icy-pub), orfalseif the header was not present.
-
metadataInterval
public final int metadataInterval
The interval in bytes between metadata chunks (icy-metaint), orC.LENGTH_UNSETif the header was not present.
-
CREATOR
public static final Parcelable.Creator<IcyHeaders> CREATOR
-
-
Method Detail
-
parse
@Nullable public static IcyHeaders parse(Map<String,List<String>> responseHeaders)
ParsesIcyHeadersfrom response headers.- Parameters:
responseHeaders- The response headers.- Returns:
- The parsed
IcyHeaders, ornullif no ICY headers were present.
-
populateMediaMetadata
public void populateMediaMetadata(MediaMetadata.Builder builder)
Description copied from interface:Metadata.EntryUpdates theMediaMetadata.Builderwith the type specific values stored in this Entry.The order of the
Metadata.Entryobjects in theMetadatamatters. If twoMetadata.Entryentries attempt to populate the sameMediaMetadatafield, then the last one in the list is used.- Specified by:
populateMediaMetadatain interfaceMetadata.Entry- Parameters:
builder- The builder to be updated.
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
-