hls_parse

Crates.iohls_parse
lib.rshls_parse
version0.1.4
sourcesrc
created_at2022-03-22 07:44:22.974749
updated_at2022-03-29 02:34:37.837438
descriptionA library for parsing m3u8 files (Apple's HTTP Live Streaming (HLS) protocol).
homepagehttps://github.com/lubezhang/hls_parse/
repositoryhttps://github.com/lubezhang/hls_parse/
max_upload_size
id554538
size767,688
zhangqh (lubezhang)

documentation

README

hls_parse

crates.io

A Rust library for parsing m3u8 playlists (HTTP Live Streaming) link.

Installation

To use this library, add the following dependency to Cargo.toml:

[dependencies]
hls_parse = "0.1.2"

Also available on crates.io

Examples

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);
Commit count: 47

cargo fmt