Closed anuragkalia closed 5 months ago
Yes, definitely possible. We just need to discuss your requirements and work on the design.
As an example, the DASH manifest parser has a configurable callback for extracting information from custom <ContentProtection>
elements. So it is definitely possible to offer hooks into the parsing process.
We're planning some cleanup and refactoring of the HLS parser, so we can work this into the plan.
Would a callback for SCTE-35 data work? Do you just need access to it the tags? Do you need to return something that would influence the parsed manifest somehow?
Thanks for the quick response!
Do you just need access to it the tags?
Yes. That is the most suitable. A callback when the fragment is parsed, along with the stream id to differentiate from parsed fragments of other streams, should work best.
Let me also take a look at the DASH parser that you mentioned. Where can I see the refactoring plans of HLS parser? I observed that HLS parser was needlessly downloading segments of all the streams rather than the currently active one, so I hope that is also one of the design goals.
We don't have a published plan for the HLS refactor at this time, but we are aware that our fetching of segment headers to extract start times is not great. It's high latency, and could be avoided in many cases, and it's something we hope to improve soon.
This will add a lot of flexibility. I am also facing a similar issue, needs to access the tags. I'm glad that this is being considered and happy to contribute as well. What is your recommendation to achieve this with the current limitations?
@joeyparrish Joey, could you either schedule this for the team or discuss the pull request design with the interested contributors!
Thanks <3
I have filed an issue with a similar use case in mind: https://github.com/google/shaka-player/issues/3523.
Right now, the interface provided by shaka player smooths over HLS and DASH differences using manifest parser plugins. But what we want is event hooks into that parsing process itself. We have some SCTE-35 ad markers in the HLS stream which we want to read as soon as they are parsed. They look like these:
Right now, there is no clean way to do it other than re-writing the HLS manifest parser itself. What is the closest approximation to achieve what I want as it stands? Is it possible to have some manifest parser events that an outside user can use?