hls

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Playlist

type Playlist struct {
	// contains filtered or unexported fields
}

Playlist the HLS playlist(m3u8 and ts files).

func NewPlaylist

func NewPlaylist() *Playlist

NewPlaylist .

func (*Playlist) Close

func (pl *Playlist) Close() error

Close .

func (*Playlist) LastAccessTime

func (pl *Playlist) LastAccessTime() time.Time

LastAccessTime 最后hls访问时间

func (*Playlist) M3u8

func (pl *Playlist) M3u8(token string) ([]byte, error)

M3u8 获取 m3u8 播放列表

func (*Playlist) Segment

func (pl *Playlist) Segment(seq int) (io.Reader, int, error)

Segment 获取 segment

type SegmentGenerator

type SegmentGenerator struct {
	// contains filtered or unexported fields
}

SegmentGenerator generate the HLS ts segment.

func NewSegmentGenerator

func NewSegmentGenerator(playlist *Playlist, path string, hlsFragment int, segmentPath string, audioRate int, logger *xlog.Logger) (*SegmentGenerator, error)

NewSegmentGenerator .

func (*SegmentGenerator) Close

func (sg *SegmentGenerator) Close() error

Close .

func (*SegmentGenerator) WriteMpegtsFrame

func (sg *SegmentGenerator) WriteMpegtsFrame(frame *mpegts.Frame) (err error)

WriteMpegtsFrame implements mpegts.FrameWriter

Jump to

Keyboard shortcuts

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