This is a fully automated change. The linter will fail because the
extra indentation caused line-length errors. These won't be fixed
automatically. They are fixed in a follow-up to make this one fully
automated.
Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
In some situations, the mp4 parser might be required to read a box
that has a "size" value that is longer than its actual size.
For example, if there was a partial range request that ends in the
middle of a box.
Obviously, trying to READ a box like that would be a bad idea, but
if the box is going to be skipped anyway, skipping it without an
error is probably not harmful.
Closes#1535
Change-Id: I31d4c00426e6127ef6e1492e9edc7e10ac50ec8b
The ParsedBox structure used by the Mp4Parser, previously, had
its property names changed in compiled mode.
This makes ParsedBox into an extern, so that it will be preserved
unchanged in compiled mode.
Closes#1522
Change-Id: I0964f8a4b9ccea57c61e2c587a776ed76cfbc8da
Previously, we would read each individual VTTC and VTTE box in the
MDAT and associate them with durations in the TRUN. This worked for a
lot of content, but if sampleSize is defined in the TRUN, a duration
might refer to multiple VTTC boxes.
This changes the VTT in mp4 reader to parse the MDAT based on the TRUN,
to account for such situations.
For the moment, this only accounts for a single MDAT, and assumes that
the MDAT contains nothing but vttc or vtte boxes, listed in order.
Issue #1266
Change-Id: I56e310d085abdda16e968761ed3b4fd0cc5e24d0
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.
This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.
Change-Id: I225f5c7e54adf4cca8512cddae082ba50ed82e4e
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I10f5c38a8b06b5797c6eec7492829084114514c9
When we started fetching partial HLS segments to find the start time,
we were no longer able to start playback for content with a moof box
larger than the partial segment. This is because we parsed the boxes
hierarchically, which required the entire payload.
Now, we can selectively instruct the parser to tolerate a partial box
if the part we have includes the child box we are looking for.
This fixes playback of several pieces of HLS content in our demo app.
Change-Id: I956c8b8905dc9f1707f2b24b8248b984b1c036c6
This speeds up HLS stream startup significantly for servers that
permit this kind of request, and falls back to full segments for
servers that do not.
Closes#1106
Change-Id: I96bc7f0df0fb84b75f3a3fe43476ba0ba5fc2264
This converts from using ArrayBuffer in the text parsers to using
Uint8Array. This avoids doing extra buffer copies when using
ArrayBuffer.slice().
Closes#1022
Change-Id: I34a789ec4eb76c95169ba81f27a8433ef25f27f0
When defining a box, the box would be defined as a four
byte integer. Now there is a "fromString" function that
can be used to convert a four character assci string to
a four byte integer.
Change-Id: I78c704e012620c94ae681efb450977305bdb84aa
Before the segment start time and end time were used to determine
the start and end time for all subtitles that appeared in the MDAT
box. The time values for each subtitle is specified in the TRUN box.
Now the time values are extracted from the TRUN box and mapped to
the correct subtitle in the MDAT box.
Closes: #699
Change-Id: I7179874aee7b617e994b136d17a082060ab1a0d2
Before parsing Mp4Boxes was done using the "findBox" method. This
was limted to only looking at one level of the structure and
required a large amount of code to dig deeper into the structure.
This change creates a generalized Mp4 Box parser that should
simplify parsing Mp4Boxes. This will help work on #699.
Change-Id: Ie67ff30a6db890cae16fe02ae9c92bca711815a9
Rather than having it in the DashParser as a network response filter,
we should have it in StreamingEngine. This will give it access to the
segment times so we can calculate the presentation times for the event.
Otherwise, there is no way to know when the event should actually occur
since the app can't know which segment is being downloaded or which it
came from.
This also adds startTime and endTime fields to the event so the app
doesn't have to calculate them. For reverse compatibility, the old
fields will still exist.
Closes#698
Change-Id: Icbaf3619aedfca7ea06bc8b1fe49e9cce65b0cc2