You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a stitching library and I need to be able to get custom tags on each individual hls segment as I'm parsing the playlist. Currently, the tags array is only on the media playlist object, rather than on individual segments, making it difficult to parse tags for each segment. Since the HlsPlaylistParser class and the HlsMediaPlaylist class are final, I can't extend to add this behavior. NOTE: This is not to get tags on currently playing segments, this is pre-playback when the manifest is being parsed, so I can stitch the manifests as needed.
Proposed solution
In playlist parser, when the tags are being created on the playlist, you can also assign these tags to the segment objects as it's looping through the playlist. Then add a property on the Segment in the Media Playlist class. I currently have a fork doing just that, I'm willing to create a PR if you believe this is beneficial.
Alternatives considered
Make the respective classes not final, so I can extend them to add custom logic.
OR
If there's something in place already for getting individual segment tags, I'd love to know. I can't find anything for doing this without adding extra loops in my code to assign tags to each segment. I'd prefer this to be as efficient as possible, so doing it in the actual parser class is optimal.
The text was updated successfully, but these errors were encountered:
[REQUIRED] Use case description
I'm building a stitching library and I need to be able to get custom tags on each individual hls segment as I'm parsing the playlist. Currently, the tags array is only on the media playlist object, rather than on individual segments, making it difficult to parse tags for each segment. Since the HlsPlaylistParser class and the HlsMediaPlaylist class are final, I can't extend to add this behavior. NOTE: This is not to get tags on currently playing segments, this is pre-playback when the manifest is being parsed, so I can stitch the manifests as needed.
Proposed solution
In playlist parser, when the tags are being created on the playlist, you can also assign these tags to the segment objects as it's looping through the playlist. Then add a property on the Segment in the Media Playlist class. I currently have a fork doing just that, I'm willing to create a PR if you believe this is beneficial.
Alternatives considered
Make the respective classes not final, so I can extend them to add custom logic.
OR
If there's something in place already for getting individual segment tags, I'd love to know. I can't find anything for doing this without adding extra loops in my code to assign tags to each segment. I'd prefer this to be as efficient as possible, so doing it in the actual parser class is optimal.
The text was updated successfully, but these errors were encountered: