#hls #m3u8 #live-streaming #parser #protocols #http #playlist

hls_parse

用于解析m3u8文件(苹果的HTTP Live Streaming(HLS)协议)的库

5个版本

0.1.4 2022年3月29日
0.1.3 2022年3月23日
0.1.2 2022年3月22日
0.1.1 2022年3月22日
0.1.0 2022年3月22日

#m3u8中排名5

MIT许可证

750KB
600

hls_parse

crates.io

一个用于解析m3u8播放列表(HTTP Live Streaming)的Rust库 链接

安装

要使用此库,请将以下依赖项添加到Cargo.toml

[dependencies]
hls_parse = "0.1.2"

也可在crates.io上找到

示例

use hls_parse::protocol::HLS;
let m3u8 = "#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXTINF:9.009,
http://media.example.com/first.ts
#EXTINF:9.009,
http://media.example.com/second.ts
#EXTINF:3.003,
http://media.example.com/third.ts
#EXT-X-ENDLIST";
let base_url = "http://media.example.com".to_string();
let mut hls = HLS::new();
hls.set_base_url(&base_url);
hls.parse(&m3u8);

依赖项

~8.5MB
~152K SLoC