This is a pure header files library used to parse M3U8. Spec depends on Apple's HTTP Live Streaming protocol.
I converted the node-m3u8 from javascript
into c++
by using Github Copilot
then made some adjustments.
All the test-cases passed (yes, I deleted some of them) but I am still not sure if everything works as expected.
TODO: Add serialize
back for download function to save a local m3u8 file.
But I am not sure if unserialize
is necessary or not.
sudo apt install nlohmann-json3-dev libcurl4-openssl-dev
mkdir build && cd build
cmake .. && make -j && make install
./test/m3u8-test
Check local file.
./example/m3u8-file ../test/fixtures/variant.m3u8
Check online playlist.
./example/m3u8-url https://muiplayer.js.org/media/media.m3u8
Download m3u8 into one single file.
./example/m3u8-download https://muiplayer.js.org/media/media.m3u8 ~/Downloads/media.ts
Play m3u8 media.
./example/m3u8-player https://muiplayer.js.org/media/media.m3u8
Need clang-format-12
at least.
find . -name "*.h" | xargs clang-format -i
find . -name "*.cpp" | xargs clang-format -i