hls

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
	// 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) WriteHeader

func (p *Publisher) WriteHeader(streams []av.CodecData) error

WriteHeader initializes the streams' codec data and must be called before the first WritePacket

func (*Publisher) WritePacket

func (p *Publisher) WritePacket(pkt av.Packet) error

WritePacket publishes a single packet

func (*Publisher) WriteTrailer

func (p *Publisher) WriteTrailer() error

WriteTrailer does nothing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL