func Bandwidth(s1, s2 *StreamInf) int
func GroupId(m1, m2 *Media) int
Key represents encryption info from a #EXT-X-KEY tag.
type Key struct { Method string Uri *url.URL KeyFormat string KeyFormatVersions string Characteristics string }
func (k *Key) DecodeData() ([]byte, error)
DecodeData extracts and decodes the Base64 data directly from the URL Opaque field.
type MasterPlaylist struct { Medias []*Media StreamInfs []*StreamInf }
func DecodeMaster(content string) (*MasterPlaylist, error)
DecodeMaster parses a Master Playlist.
func (mp *MasterPlaylist) ResolveUris(base *url.URL)
Media represents an #EXT-X-MEDIA tag.
type Media struct { AutoSelect bool Channels string GroupId string Id int Language string Name string Type string Uri *url.URL }
func (r *Media) String() string
String returns a multi-line summary of the Media.
type MediaPlaylist struct { TargetDuration int MediaSequence int Version int PlaylistType string Segments []*Segment Keys []*Key // A slice of all keys found in the playlist Map *url.URL // The playlist's initialization map EndList bool }
func DecodeMedia(content string) (*MediaPlaylist, error)
DecodeMedia parses a Media Playlist.
func (mp *MediaPlaylist) ResolveUris(base *url.URL)
type Segment struct { Uri *url.URL Duration float64 Title string }
StreamInf represents a single media playlist (URI) from a #EXT-X-STREAM-INF tag. It aggregates information from all tags that point to the same URI. The primary attributes are taken from the variant with the lowest bandwidth.
type StreamInf struct { Audio []string // A list of associated audio Media GROUP-IDs AverageBandwidth int Bandwidth int Codecs string FrameRate string Id int Resolution string Subtitles string // Refers to a Media GROUP-ID for subtitles Uri *url.URL }
func (s *StreamInf) String() string
String returns a multi-line summary of the StreamInf.