Split parsing into tokenization and a very liberal parser. After this, an "interpreter" needs to be created to build an object representation of the manifest based on the events emitted by the parser. Higher-level manifest tests are broken until that interpreter is written.
Add the peg parser generation step to the gruntfile. Include the generated parser in the test harness page. Update many of the m3u8 tests to work with the new parser. There are a number of tests still failing. I believe this is because parts of the grammar are not sufficiently flexible to handle some optional parameters. For instance, #EXT-X-BYTE-RANGE is being glommed incorrectly into the #EXTINF definition and that's throwing off parsing. This commit is a progress checkpoint; things are definitely not working correctly.
The actionscript segment parser uses a 4-byte terminator for "ecmascriptarray" objects in script tags. This doesn't match my reading of the spec but we'll go with it for now to get these things binary-compatible. The writeBytes method on FlvTag defaults the length argument to zero but in that case, the entire bytes argument should be written out instead of nothing.
loadWord wasn't incrementing the position in the byte stream so fix it so that the accounting is taken care of. Replace a bunch of single-letter variable names with more descriptive terms. Add some comments. Add tests for exponential golomb parsing.
Fix up a couple remaining issues with the HLS->FLV translation. At this point, we've validated that the generated file can be played back in VLC if you download it to your computer. Added another ts segment for testing purposes. Added unit testing that traverses the generated FLV and validates the tags are constructed correctly and seem consistent.
The parser can process the example TS but it doesn't appear to be correctly formed. The player does seem to correctly interpret the video duration, but the display area is black and there is no audio.
Create a qunit test to verify the flv header. Start work on parsing the m2ts packets. The test harness is using a hard-coded Uint8Array which is the first segment of the "bipbop" video. Currently the segment parser is consuming bytes and passing them off to the internal packet parsing function but that isn't yet implemented.