@UnstableApi
public final class IcyHeaders implements Metadata.Entry


ICY headers.

Summary

Constants

static final Parcelable.Creator<IcyHeaders>
static final String
static final String

Public fields

final int

Bitrate in bits per second ((icy-br * 1000)), or NO_VALUE if the header was not present.

final @Nullable String

The genre (icy-genre).

final boolean

Whether the radio station is listed (icy-pub), or false if the header was not present.

final int

The interval in bytes between metadata chunks (icy-metaint), or LENGTH_UNSET if the header was not present.

final @Nullable String

The stream name (icy-name).

final @Nullable String

The URL of the radio station (icy-url).

Public constructors

IcyHeaders(
    int bitrate,
    @Nullable String genre,
    @Nullable String name,
    @Nullable String url,
    boolean isPublic,
    int metadataInterval
)

Public methods

int
boolean
int
static @Nullable IcyHeaders
parse(Map<StringList<String>> responseHeaders)

Parses IcyHeaders from response headers.

void

Updates the MediaMetadata.Builder with the type-specific values stored in this Entry.

String
void
writeToParcel(Parcel dest, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Inherited methods

From androidx.media3.common.Metadata.Entry
@Nullable byte[]

Returns the bytes of the wrapped metadata in this Entry, or null if it doesn't contain wrapped metadata.

@Nullable Format

Returns the Format that can be used to decode the wrapped metadata in getWrappedMetadataBytes, or null if this Entry doesn't contain wrapped metadata.

Constants

CREATOR

public static final Parcelable.Creator<IcyHeadersCREATOR

REQUEST_HEADER_ENABLE_METADATA_NAME

public static final String REQUEST_HEADER_ENABLE_METADATA_NAME = "Icy-MetaData"

REQUEST_HEADER_ENABLE_METADATA_VALUE

public static final String REQUEST_HEADER_ENABLE_METADATA_VALUE = "1"

Public fields

bitrate

public final int bitrate

Bitrate in bits per second ((icy-br * 1000)), or NO_VALUE if the header was not present.

genre

public final @Nullable String genre

The genre (icy-genre).

isPublic

public final boolean isPublic

Whether the radio station is listed (icy-pub), or false if the header was not present.

metadataInterval

public final int metadataInterval

The interval in bytes between metadata chunks (icy-metaint), or LENGTH_UNSET if the header was not present.

name

public final @Nullable String name

The stream name (icy-name).

url

public final @Nullable String url

The URL of the radio station (icy-url).

Public constructors

IcyHeaders

public IcyHeaders(
    int bitrate,
    @Nullable String genre,
    @Nullable String name,
    @Nullable String url,
    boolean isPublic,
    int metadataInterval
)
Parameters
int bitrate

See bitrate.

@Nullable String genre

See genre.

@Nullable String name

See See.

@Nullable String url

See url.

boolean isPublic

See isPublic.

int metadataInterval

See metadataInterval.

Public methods

describeContents

public int describeContents()

equals

public boolean equals(@Nullable Object obj)

hashCode

public int hashCode()

parse

public static @Nullable IcyHeaders parse(Map<StringList<String>> responseHeaders)

Parses IcyHeaders from response headers.

Parameters
Map<StringList<String>> responseHeaders

The response headers.

Returns
@Nullable IcyHeaders

The parsed IcyHeaders, or null if no ICY headers were present.

populateMediaMetadata

public void populateMediaMetadata(MediaMetadata.Builder builder)

Updates the MediaMetadata.Builder with the type-specific values stored in this Entry.

Parameters
MediaMetadata.Builder builder

The builder to be updated.

toString

public String toString()

writeToParcel

public void writeToParcel(Parcel dest, int flags)