media

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadHLS

func DownloadHLS(fetch Fetch, playlistURL, target string) (int64, error)

DownloadHLS 下载一个已结束的 HLS 媒体播放列表,并将解密后的媒体分片串接到 target。

func DownloadImage

func DownloadImage(fetch Fetch, sourceURL, target string) (int64, error)

DownloadImage 下载并还原图片 CDN 返回的图片数据,再以新文件方式写入 target。

Types

type Fetch

type Fetch func(string) ([]byte, error)

Fetch 是 client 提供给媒体解码器的原始资源读取回调。

type MediaEndpoint

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

MediaEndpoint 提供图片与 HLS 预览媒体的下载 capability。

func NewMedia

func NewMedia(fetch Fetch) *MediaEndpoint

NewMedia 用 transport 提供的原始资源读取回调构造 media capability。

func (*MediaEndpoint) DownloadHLS

func (e *MediaEndpoint) DownloadHLS(playlistURL, target string) (int64, error)

DownloadHLS 下载已结束的 HLS 预览媒体,委托包级纯实现。

func (*MediaEndpoint) DownloadImage

func (e *MediaEndpoint) DownloadImage(sourceURL, target string) (int64, error)

DownloadImage 下载并还原图片媒体,委托包级纯实现。

Jump to

Keyboard shortcuts

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