Class StreamFormat
java.lang.Object
dev.lavalink.youtube.track.format.StreamFormat
Describes an available media format for a track
-
Constructor Summary
ConstructorsConstructorDescriptionStreamFormat(org.apache.http.entity.ContentType type, int itag, long bitrate, long contentLength, long audioChannels, String url, String nParameter, String signature, String signatureKey, boolean isDefaultAudioTrack, boolean isDrc) StreamFormat(org.apache.http.entity.ContentType type, int itag, long bitrate, long contentLength, long audioChannels, String url, String nParameter, String signature, String signatureKey, boolean isDefaultAudioTrack, boolean isDrc, long lastModified, String xtags) -
Method Summary
Modifier and TypeMethodDescriptionlonglonglong@Nullable FormatInfogetInfo()intgetItag()long@Nullable String@Nullable String@Nullable String@NotNull org.apache.http.entity.ContentTypegetType()@NotNull URIgetUrl()@Nullable StringgetXtags()booleanbooleanisDrc()booleanisSabr()toString()
-
Constructor Details
-
StreamFormat
public StreamFormat(org.apache.http.entity.ContentType type, int itag, long bitrate, long contentLength, long audioChannels, String url, String nParameter, String signature, String signatureKey, boolean isDefaultAudioTrack, boolean isDrc) - Parameters:
type- Mime type of the formatbitrate- Bitrate of the formatcontentLength- Length in bytes of the mediaaudioChannels- Number of audio channelsurl- Base URL for the playback of this formatnParameter- n parameter for this formatsignature- Cipher signature for this formatsignatureKey- The key to use for deciphered signature in the final playback URLisDefaultAudioTrack- Whether this format contains an audio track that is used by default.isDrc- Whether this format has Dynamic Range Compression.
-
StreamFormat
public StreamFormat(org.apache.http.entity.ContentType type, int itag, long bitrate, long contentLength, long audioChannels, String url, String nParameter, String signature, String signatureKey, boolean isDefaultAudioTrack, boolean isDrc, long lastModified, String xtags) - Parameters:
type- Mime type of the formatbitrate- Bitrate of the formatcontentLength- Length in bytes of the mediaaudioChannels- Number of audio channelsurl- Base URL for the playback of this format. May benullfor SABR-only formats.nParameter- n parameter for this formatsignature- Cipher signature for this formatsignatureKey- The key to use for deciphered signature in the final playback URLisDefaultAudioTrack- Whether this format contains an audio track that is used by default.isDrc- Whether this format has Dynamic Range Compression.lastModified- The format's last-modified timestamp (lmt), used for SABR requests.xtags- The format's xtags string, used for SABR requests.
-
-
Method Details
-
getInfo
- Returns:
- Format container and codec info
-
getType
@NotNull public @NotNull org.apache.http.entity.ContentType getType()- Returns:
- Mime type of the format
-
getItag
public int getItag() -
getBitrate
public long getBitrate()- Returns:
- Bitrate of the format
-
getAudioChannels
public long getAudioChannels()- Returns:
- Count of audio channels in format
-
getUrl
- Returns:
- Base URL for the playback of this format
-
isSabr
public boolean isSabr()- Returns:
trueif this format has no direct playback URL and must be played via SABR.
-
getLastModified
public long getLastModified()- Returns:
- The format's last-modified timestamp (lmt), used to identify the format in SABR requests.
-
getXtags
- Returns:
- The format's xtags string, used to identify the format in SABR requests.
-
getContentLength
public long getContentLength()- Returns:
- Length in bytes of the media
-
getNParameter
- Returns:
- n parameter for this format
-
getSignature
- Returns:
- Cipher signature for this format
-
getSignatureKey
- Returns:
- The key to use for deciphered signature in the final playback URL
-
isDefaultAudioTrack
public boolean isDefaultAudioTrack()- Returns:
- Whether this format contains an audio track that is used by default.
-
isDrc
public boolean isDrc()- Returns:
- Whether this format has Dynamic Range Compression.
-
toString
-