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
177 stars 37 forks source link

Replacing HSPlaylist with MasterPlaylist and VariantPlaylist for better type safety and clearer interfaces #45

Closed dcoufal closed 5 years ago

dcoufal commented 5 years ago

Description

This PR implements feature #5.

The old HLSPlaylist struct was used for both master and variants. This meant that, in many circumstances, there had to be run time checks for "playlist type" (i.e. master vs. variant). It also meant that there were interfaces that were part of HLSPlaylist that had no meaning for master playlists, which was confusing.

This PR removes the old HLSPlaylist and replaces it with MasterPlaylist and VariantPlaylist.

This was done by making a new generic PlaylistCore object that is specialized for master and variant flavors at compile time.

This is a breaking change and we have switched to version 2.0 to signify this.

Change Notes

Pre-submission Checklist