Closed cmacq2 closed 5 years ago
@cmacq2 Thanks for sharing the real-world scenarios. I agree with the idea of relaxing assertions in those cases. I think we can simply disable any assertions unless a special environment variable is set. Here's the change:
https://github.com/kuu/hls-parser/commit/2c54adc138c5a1def267a9cc3cc397df0b41d8bb
Please tell me your opinion. Thanks
This approach should sort of work, but I think it is not very obvious to the user of the library and a bit awkward to use. If possible it would be a lot nicer (and more in keeping with lots of other JavaScript libraries) if a developer could optionally pass an options property hash to parse()
etc. Code using this convention would look like this:
const HLSParser = require('hls-parser');
const text = ... // obtain m3u text somehow
const parsed = HLSParser.parse(text, {strict: false});
The default behavior has changed and now the library does not throw unless {strictMode: true} is specified via HLS.setOptions() The change has already been published as hls-parser@0.3.0
The
hls-parser
is somewhat opinionated about constructs which turn up in 'real world' scenario's, such as the BipBop hello world HLS stream. To demonstrate:I guess the question is: should
hls-parser
relax some of its assertions to cope with this?