hls

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package hls provides functions to download HLS streams.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrHLSForbidden is returned when the HLS download is stopped with a forbidden error.
	ErrHLSForbidden = errors.New("hls download stopped with forbidden error")
)

Functions

This section is empty.

Types

type Downloader

type Downloader struct {
	*http.Client
	// contains filtered or unexported fields
}

Downloader is used to download HLS streams.

func NewDownloader

func NewDownloader(
	client *http.Client,
	log *zerolog.Logger,
	packetLossMax int,
	url string,
) *Downloader

NewDownloader creates a new HLS downloader.

func (*Downloader) GetFragmentURLs

func (hls *Downloader) GetFragmentURLs(ctx context.Context) ([]string, error)

GetFragmentURLs fetches the fragment URLs from the HLS manifest.

func (*Downloader) Read

func (hls *Downloader) Read(ctx context.Context, out chan<- []byte) error

Jump to

Keyboard shortcuts

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