dash.js icon indicating copy to clipboard operation
dash.js copied to clipboard

Use dash.js for manifest parsing

Open giorgos-epitropou-obs opened this issue 1 year ago • 2 comments

Maybe it's already available in some way, but I haven't been able to find it. So this is more a question than a feature request. The attach source function requires either a URL or a parsed manifest. Therefore, I'm curious whether it's possible to parse the manifest using dash.js. Thanks!

P.S. I've encountered some situations where the source's mimetype isn't immediately accessible (e.g., via PHP), so I need to use XHR to check the headers and determine if the source is indeed an mpd file. I’d like to skip this additional network request because dash.js will end up re-requesting the same file. It would be more convenient to pass a parsed manifest directly (in case I fetched successfully a manifest and parse/JSON it) .

giorgos-epitropou-obs avatar Oct 26 '23 07:10 giorgos-epitropou-obs

also, in case there is no way to do it, any suggestion for converting the manifest to a json version like the example from here https://reference.dashif.org/dash.js/nightly/samples/advanced/load_with_manifest.html would help greatly

giorgos-epitropou-obs avatar Oct 26 '23 08:10 giorgos-epitropou-obs

Unfortunately, there is no convenient way to use the DASH parser of dash.js as a standalone module. You can use the X2JS library for parsing the XML to JSON similar to what dash.js is doing in DashParser.js. However, there is an additional step that requires objectIron. Ideally, you can somehow extract these components from the logic in dash.js and include it in your application. DashParser.js is the starting point here.

dsilhavy avatar Oct 27 '23 09:10 dsilhavy