google / google/ExoPlayer

Support tags array on HlsMediaPlaylist Segment

Open
#7,021 0 comments 0 reactions 1 assignee Claimed by @AquilesCanta View on GitHub
enhancement needs triage
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### [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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.