Crates.io | hls_parse |
lib.rs | hls_parse |
version | 0.1.4 |
source | src |
created_at | 2022-03-22 07:44:22.974749 |
updated_at | 2022-03-29 02:34:37.837438 |
description | A library for parsing m3u8 files (Apple's HTTP Live Streaming (HLS) protocol). |
homepage | https://github.com/lubezhang/hls_parse/ |
repository | https://github.com/lubezhang/hls_parse/ |
max_upload_size | |
id | 554538 |
size | 767,688 |
A Rust library for parsing m3u8 playlists (HTTP Live Streaming) link.
To use this library, add the following dependency to Cargo.toml
:
[dependencies]
hls_parse = "0.1.2"
Also available on 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);