Documentation
¶
Index ¶
- type ExtendedPacket
- type Publisher
- func (p *Publisher) Close()
- func (p *Publisher) Discontinuity()
- func (p *Publisher) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (p *Publisher) WriteExtendedPacket(pkt ExtendedPacket) error
- func (p *Publisher) WriteHeader(streams []av.CodecData) error
- func (p *Publisher) WritePacket(pkt av.Packet) error
- func (p *Publisher) WriteTrailer() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtendedPacket ¶ added in v1.1.0
type ExtendedPacket struct { av.Packet // ProgramTime indicates the wall-clock time of a keyframe packet ProgramTime time.Time }
ExtendedPacket holds a packet with additional metadata for the HLS playlist
type Publisher ¶
type Publisher struct { // InitialDuration is a guess for the TARGETDURATION field in the playlist, used until the first segment is complete InitialDuration time.Duration // BufferLength is the approximate duration spanned by all the segments in the playlist. Old segments are removed until the playlist length is less than this value. BufferLength time.Duration // WorkDir is a temporary storage location for segments. Can be empty, in which case the default system temp dir is used. WorkDir string // Prefetch indicates that low-latency HLS (LHLS) tags should be used // https://github.com/video-dev/hlsjs-rfcs/blob/a6e7cc44294b83a7dba8c4f45df6d80c4bd13955/proposals/0001-lhls.md Prefetch bool Precreate int // contains filtered or unexported fields }
Publisher implements a live HLS stream server
func (*Publisher) Close ¶ added in v0.3.0
func (p *Publisher) Close()
Close frees resources associated with the publisher
func (*Publisher) Discontinuity ¶
func (p *Publisher) Discontinuity()
Discontinuity inserts a marker into the playlist before the next segment indicating that the decoder should be reset
func (*Publisher) ServeHTTP ¶
func (p *Publisher) ServeHTTP(rw http.ResponseWriter, req *http.Request)
serve the HLS playlist and segments
func (*Publisher) WriteExtendedPacket ¶ added in v1.1.0
func (p *Publisher) WriteExtendedPacket(pkt ExtendedPacket) error
WriteExtendedPacket publishes a packetw ith additional metadata
func (*Publisher) WriteHeader ¶
WriteHeader initializes the streams' codec data and must be called before the first WritePacket
func (*Publisher) WritePacket ¶
WritePacket publishes a single packet
Click to show internal directories.
Click to hide internal directories.