Documentation
¶
Index ¶
- Constants
- type ByteRangeSegment
- type DateRangeSegment
- type DateTimeSegment
- type InfSegment
- type KeySegment
- type ListType
- type MapSegment
- type MediaSegment
- type PartInfSegment
- type PartSegment
- type Playlist
- type PlaylistSegment
- type RenditionReportSegment
- type Resolution
- type ServerControlSegment
- type SessionDataSegment
- type SessionKeySegment
- type SkipSegment
- type StartSegment
- type States
- type VariantSegment
Constants ¶
const ( // Playlist EXTM3U = `#EXTM3U` ExtENDList = `#EXT-X-ENDLIST` ExtTargetDutation = `#EXT-X-TARGETDURATION` ExtAllowCache = `#EXT-X-ALLOW-CACHE` ExtDiscontinuitySequence = `#EXT-X-DISCONTINUITY-SEQUENCE` ExtIndependentSegments = `#EXT-X-INDEPENDENT-SEGMENTS` ExtPlaylistType = `#EXT-X-PLAYLIST-TYPE` ExtIFramesOnly = `#EXT-X-I-FRAMES-ONLY` ExtMediaSequence = `#EXT-X-MEDIA-SEQUENCE` ExtVersion = `#EXT-X-VERSION` // Variant Playlist ExtSessionKey = `#EXT-X-SESSION-KEY` ExtKey = `#EXT-X-KEY` ExtDiscontinuity = `#EXT-X-DISCONTINUITY` ExtProgramDateTime = `#EXT-X-PROGRAM-DATE-TIME` ExtDateRange = `#EXT-X-DATERANGE` ExtMap = `#EXT-X-MAP` ExtSessionData = `#EXT-X-SESSION-DATA` EXTINF = `#EXTINF` ExtByteRange = `#EXT-X-BYTERANGE` ExtStart = `#EXT-X-START` ExtMedia = `#EXT-X-MEDIA` ExtStreamInf = `#EXT-X-STREAM-INF` ExtFrameStreamInf = `#EXT-X-I-FRAME-STREAM-INF` // for low-latency ExtServerControl = `#EXT-X-SERVER-CONTROL` ExtPartInf = `#EXT-X-PART-INF` ExtPart = `#EXT-X-PART` ExtRenditionReport = `#EXT-X-RENDITION-REPORT` ExtSkip = `#EXT-X-SKIP` // rendition report LASTMSN = "LAST-MSN" LASTPART = "LAST-PART" // server control CANBLOCKRELOAD = "CAN-BLOCK-RELOAD" HOLDBACK = "HOLD-BACK" PARTHOLDBACK = "PART-HOLD-BACK" CANSKIPUNTIL = "CAN-SKIP-UNTIL" // part PARTTARGET = "PART-TARGET" INDEPENDENT = "INDEPENDENT" GAP = "GAP" // skip SKIPPEDSEGMENTS = "SKIPPED-SEGMENTS" // Utility tag URI = "URI" DURATION = "DURATION" // ByteRange BYTERANGE = "BYTERANGE" // Encrypt key METHOD = "METHOD" IV = "IV" KEYFORMAT = "KEYFORMAT" KEYFORMATVERSIONS = "KEYFORMATVERSIONS" // DateRange ID = "ID" CLASS = "CLASS" STARTDATE = "START-DATE" ENDDATE = "END-DATE" PLANNEDDURATION = "PLANNED-DURATION" SCTE35CMD = "SCTE35-CMD" SCTE35OUT = "SCTE35-OUT" SCTE35IN = "SCTE35-IN" ENDONNEXT = "END-ON-NEXT" // Ext-Start TIMEOFFSET = "TIME-OFFSET" PRECISE = "PRECISE" // Session DATAID = "DATA-ID" VALUE = "VALUE" // MediaType TYPE = "TYPE" GROUPID = "GROUP-ID" LANGUAGE = "LANGUAGE" ASSOCLANGUAGE = "ASSOC-LANGUAGE" NAME = "NAME" AUTOSELECT = "AUTOSELECT" FORCED = "FORCED" DEFAULT = "DEFAULT" INSTREAMID = "INSTREAM-ID" CHARACTERISTICS = "CHARACTERISTICS" CHANNELS = "CHANNELS" /// Variant RESOLUTION = "RESOLUTION" PROGRAMID = "PROGRAM-ID" CODECS = "CODECS" BANDWIDTH = "BANDWIDTH" AVERAGEBANDWIDTH = "AVERAGE-BANDWIDTH" FRAMERATE = "FRAME-RATE" VIDEO = "VIDEO" AUDIO = "AUDIO" SUBTITLES = "SUBTITLES" CLOSEDCAPTIONS = "CLOSED-CAPTIONS" HDCPLEVEL = "HDCP-LEVEL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteRangeSegment ¶
type ByteRangeSegment struct {
Length int64 // the length of the sub-range in bytes
Offset int64 // a byte offset from the beginning of the resource
Extflag bool // whether EXT-BYTERANGE or BYTERANGE
}
EXT-X-BYTERANGE or BYTERANGE segment
func NewByteRange ¶
func NewByteRange(line string) (*ByteRangeSegment, error)
func (*ByteRangeSegment) String ¶
func (bs *ByteRangeSegment) String() string
type DateRangeSegment ¶
type DateRangeSegment struct {
ID string
Class string
StartDate time.Time
EndDate time.Time
Duration float64
PlannedDuration float64
Scte35Cmd string
Scte35Out string
Scte35In string
EndOnNext bool
}
EXT-X-DATERANGE range of time defined by a starting and ending date with a set of attribute / value pairs
func NewDateRange ¶
func NewDateRange(line string) (*DateRangeSegment, error)
func (*DateRangeSegment) String ¶
func (ds *DateRangeSegment) String() string
type DateTimeSegment ¶
EXT-X-PROGRAM-DATE-TIME tag segment
func NewProgramDateTime ¶
func NewProgramDateTime(line string) (*DateTimeSegment, error)
func (*DateTimeSegment) String ¶
func (ds *DateTimeSegment) String() string
type InfSegment ¶
type InfSegment struct {
Duration float64
URI string
ByteRange *ByteRangeSegment
}
EXTINF segment and, under uri
func NewExtInf ¶
func NewExtInf(line string) (*InfSegment, error)
func (*InfSegment) String ¶
func (is *InfSegment) String() string
type KeySegment ¶
type KeySegment struct {
Method string
IV string // Initialization Vector
URI string
KeyFormat string
KeyFormatVersions string
}
For decrypt media segments
func NewKey ¶
func NewKey(line string) (*KeySegment, error)
func (*KeySegment) String ¶
func (ks *KeySegment) String() string
type MapSegment ¶
type MapSegment struct {
URI string
ByteRange *ByteRangeSegment
}
EXT-X-MAP segment
func NewMap ¶
func NewMap(line string) (*MapSegment, error)
func (*MapSegment) String ¶
func (ms *MapSegment) String() string
type MediaSegment ¶
type MediaSegment struct {
Type string
GroupID string
Language string
AssocLanguage string
Name string
Autoselect bool
Forced bool
Default bool
URI string
InstreamID string
Characteristics string
Channels string
}
The EXT-X-MEDIA tag is used to relate Playlists that contain alternative renditions of the same content.
func NewMedia ¶
func NewMedia(line string) (*MediaSegment, error)
NewMedia parse line has #EXT-X-MEDIA
func (*MediaSegment) String ¶
func (ms *MediaSegment) String() string
type PartInfSegment ¶
type PartInfSegment struct {
PartTartget float64
}
func NewPartInf ¶
func NewPartInf(line string) (*PartInfSegment, error)
func (*PartInfSegment) String ¶
func (ps *PartInfSegment) String() string
type PartSegment ¶
type PartSegment struct {
Duration float64
URI string
Independent bool
ByteRange *ByteRangeSegment
Gap bool
}
func NewPart ¶
func NewPart(line string) (*PartSegment, error)
func (*PartSegment) String ¶
func (ps *PartSegment) String() string
type Playlist ¶
type Playlist struct {
Version uint8
PlaylistType string
AllowCache bool
MediaSequence uint64
DiscontinuitySequence uint64
TargetDuration float64
IndependentSegments bool
IFrameOnly bool // EXT-X-I-FRAMES-ONLY
Discontinty bool // EXT-X-DISCONTINUITY encoding discontinuity between the media segment that follows it and the one that preceded it.
Segments []PlaylistSegment
// contains filtered or unexported fields
}
master and media platlist segment
func DecodeFrom ¶
DecodeFrom read a playlist passed from the io.Reader
func NewPlaylist ¶
func NewPlaylist() *Playlist
func (*Playlist) AppendSegment ¶
func (p *Playlist) AppendSegment(pseg PlaylistSegment)
type PlaylistSegment ¶
type PlaylistSegment interface {
String() string
}
type RenditionReportSegment ¶
func NewReport ¶
func NewReport(line string) (*RenditionReportSegment, error)
func (*RenditionReportSegment) String ¶
func (rs *RenditionReportSegment) String() string
type Resolution ¶
RESOLUTION=640x360
func NewResolution ¶
func NewResolution(item map[string]string, param string) (*Resolution, error)
func (*Resolution) String ¶
func (r *Resolution) String() string
type ServerControlSegment ¶
type ServerControlSegment struct {
CanBlockReload bool
CanSkipUntil float64
HoldBack float64
PartHoldBack float64
}
ServerControl indicate support for features such as Blocking Playlist Reload and Playlist Delta Updates
func NewServerControl ¶
func NewServerControl(line string) (*ServerControlSegment, error)
New server control segment
func (*ServerControlSegment) String ¶
func (ss *ServerControlSegment) String() string
segment to string
type SessionDataSegment ¶
EXT-X-SESSION-DATA segment
func NewSessionData ¶
func NewSessionData(line string) (*SessionDataSegment, error)
func (*SessionDataSegment) String ¶
func (ss *SessionDataSegment) String() string
type SessionKeySegment ¶
type SessionKeySegment struct {
Method string
IV string // Initialization Vector
URI string
KeyFormat string
KeyFormatVersions string
}
EXT-X-SESSION-KEY segment
func NewSessionKey ¶
func NewSessionKey(line string) (*SessionKeySegment, error)
func (*SessionKeySegment) String ¶
func (ss *SessionKeySegment) String() string
type SkipSegment ¶
type SkipSegment struct {
SkippedSegments uint64
}
func NewSkip ¶
func NewSkip(line string) (*SkipSegment, error)
func (*SkipSegment) String ¶
func (ss *SkipSegment) String() string
type StartSegment ¶
EXT-X-START segment
func NewStart ¶
func NewStart(line string) (*StartSegment, error)
func (*StartSegment) String ¶
func (ss *StartSegment) String() string
type States ¶
type States struct {
// contains filtered or unexported fields
}
state of m3u and temporary store segments, stream inf...etc
type VariantSegment ¶
type VariantSegment struct {
IFrame bool
URI string
Bandwidth uint32
Name string
Subtitle string
AverageBandwidth uint32
ProgramID uint32
Codecs string
AudioCodec string
Audio string
Video string
FrameRate float64
ClosedCaptions string
HDCPLevel string
Resolution *Resolution
}
EXT-X-STREAM-INF or EXT-X-I-FRAME-STREAM-INF segment
func NewVariant ¶
func NewVariant(line string) (*VariantSegment, error)
NewVariant parse line has EXT-X-STREAM-INF or EXT-X-I-FRAME-STREAM-INF
func (*VariantSegment) String ¶
func (vs *VariantSegment) String() string