Class: shaka.metadata.VorbisUtils

Constructor

new VorbisUtils()

Implements:
Source:

Members

VORBIS_TO_ID3_MAP_ :Object<string, string>

Type:
  • Object<string, string>
Source:

Methods

parse(datanon-null) → {Array<!shaka.extern.MetadataFrame>}

Parses {@code data} and returns every metadata frame found in it. Implementations MUST:
  • Return an empty array (never {@code null}) when no frames are found or the data is not recognised.
  • Not throw; all errors should be swallowed and result in an empty or partial return value.
  • Use ID3v2.4 four-character frame IDs as {@code key} values wherever a mapping exists (see class-level documentation).
Parameters:
Name Type Description
data Uint8Array Raw bytes of the media segment or file.
Implements:
Source:
Returns:
Type
Array<!shaka.extern.MetadataFrame>

parseFlacPicture_(blocknon-null) → {shaka.extern.MetadataFrame}

Parse a FLAC PICTURE metadata block (type 6) and return it as an APIC-equivalent MetadataFrame so that callers can treat album art from FLAC files the same way they treat ID3v2 APIC frames. FLAC PICTURE block layout (all fields big-endian): [0-3] picture type (uint32 BE) [4-7] MIME length (uint32 BE) [8 … 8+mimeLen-1] MIME type string (UTF-8) [8+mimeLen … +3] description length (uint32 BE) […+descLen-1] description string (UTF-8) [… + 4] width (uint32 BE) – ignored [… + 4] height (uint32 BE) – ignored [… + 4] color depth (uint32 BE) – ignored [… + 4] color count (uint32 BE) – ignored [… + 4] data length (uint32 BE) [… + dataLen] raw image bytes
Parameters:
Name Type Description
block Uint8Array Raw bytes of the PICTURE metadata block body (i.e. the 4-byte block header has already been stripped).
Source:
Returns:
Type
shaka.extern.MetadataFrame

parseVorbisCommentBlock_(datanon-null) → {Array<!shaka.extern.MetadataFrame>}

Parse Vorbis comment structure.
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
Array<!shaka.extern.MetadataFrame>