Comcast / mamba

Mamba is a Swift iOS, tvOS and macOS framework to parse, validate and write HTTP Live Streaming (HLS) data.
Apache License 2.0
180 stars 40 forks source link

Add a simple function to return segment based info from info about a tag to look for. #42

Closed dcoufal closed 5 years ago

dcoufal commented 5 years ago

Description

It's a common task to ask "what time does this tag appear in a variant playlist" or "where does this tag appear in a variant"? This info is available via mamba but it's a little bit of a pain to get and non-obvious.

This ticket is to add a one-liner syntactic sugar function to get this info.

There should be functions that return (1) an array of times (probably CMTime if feasible) (2) an array of media sequence numbers (3) an array of tag indexes (i.e. indexes into the playlist tag array) and (4) an array of tag group indexes (i.e. indexes into the media groups array). This function should take some kind of predicate (probably a closure that takes a HLSTag and returns true or false for a match)

This task depends on https://github.com/Comcast/mamba/issues/5 and should only be added to VariantPlaylists. The array of times potentially does not make sense for LIVE playlists, so we'll have to figure out what to do there.

Tasks

References

dcoufal commented 5 years ago

Addressed