Skip to content

Commit 882d0c5

Browse files
authored
Support for low-latency media playlist (#33)
* feat: support #EXT-X-PART-INF:PART-TARGET tag * feat: skip expired partial segments * feat: support #EXT-X-SKIP tag
1 parent 3b6a316 commit 882d0c5

12 files changed

+1586
-69
lines changed

.github/workflows/coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- run: go test -v -coverprofile=profile.cov ./...
2020
- uses: shogo82148/actions-goveralls@v1
2121
with:
22-
path-to-profile: profile.cov
22+
path-to-profile: profile.cov

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- EncodeWithSkip() to media playlist
13+
- EXT-X-PART support
14+
- EXT-X-PART-INF support
15+
- EXT-X-SERVER-CONTROL support
16+
- EXT-X-PRELOAD-HINT support
17+
- EXT-X-SKIP support
1218
- EXT-X-GAP support
1319
- EXT-X-SESSION-KEY support
1420
- EXT-X-CONTENT-STEERING support

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ There is a function `Decode`, that decodes and autodetects the type of playlist,
3232
both in parallel, and stopping one, once the type is known.
3333

3434
For generating playlists, one starts by calling either `NewMasterPlaylist` or `NewMediaPlaylist`.
35-
One can then `Set` or `Append` extra data.
35+
One can then `Set` or `Append` extra data. For example, one can `Append` a full media segment or
36+
`AppendPartial` a partial segment to Low-Latency HLS media playlists.
3637

3738
For live media playlists with a fixed sliding window, one
3839
can set a `winsize` and it will be used to always output
@@ -41,6 +42,7 @@ the latest segments.
4142
For VOD or EVENT media playlists, the `winsize` should be 0.
4243

4344
For writing, there are `Encode` methods that return a `*bytes.Buffer`. This buffer serves as a cache.
45+
It is also possible to call `EncodeWithSkip` to skip the first `n` segments.
4446

4547
## Installation / Usage
4648

m3u8/read_write_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ func TestReadWritePlaylists(t *testing.T) {
399399
"media-playlist-with-start-time.m3u8",
400400
"master-with-independent-segments.m3u8",
401401
"media-playlist-with-gap.m3u8",
402+
"media-playlist-low-latency.m3u8",
403+
"media-playlist-with-skip.m3u8",
402404
}
403405

404406
for _, fileName := range files {

0 commit comments

Comments
 (0)