Manifest parser as an external module
Created by: wilaw
[posting on behalf of Shachar at Peer5]
As part of our progress in supporting DASH, we have found the need to upgrade our DASH manifest parser.Instead of upgrading and maintaining our own parser, we'd like to use dash.js's
We tried doing that, and indeed using just the DashParser.js module is easy and returns a valid JS object that we can work with, but unfortunately it is not enough for us, as we need some additional utility functions to digest that parsed manifest.
Those utility functions mostly exist in dash.js in one way or another, but they are not easily extractable from dash.js itself without doing a lot of twist & turns in order to get them work (Handling dependency injection, passing correct context, etc).
Would it be possible to either extract the entire manifest parsing & utility functions to either an external module that can be "require"ed separately from dash.js, or keep them inside dash.js but make them "require"able without having to initialize complex configurations?
Specifically the utility functions that we're looking for are:
- Get a list of all the segments in a representation (Or up to a given limit). Similar to
getSegments
- https://github.com/Dash-Industry-Forum/dash.js/blob/v2.6.7/src/dash/utils/SegmentsGetter.js#L54 - Reverse representation lookup - Given a URL of a segment, we would like a way to find which representation that segment belongs to (We can probably do it ourselves, given that all of the template variables are exposed on the representation)
- Calculate duration between two segments (Not necessarily adjacent ones) - We would like a function to return the duration in milliseconds between two segment URLs (And given a representation of course).
- Get the last available segment in a representation - As DASH manifests are mostly static and contain the needed information to calculate which segments are available on the server at any given point in time, we would like a method that exposes that functionality given a specific representation.
Let me know what you think, Thanks!