This ensures that we get the expected types and that type coercion
doesn't convert between types. This also ensures we are consistent
in how we check for equality of primitives in tests.
Change-Id: I9f3aacdf25ab1afe5e8d6e4b895b5299ee687d54
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
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
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
When CEA captions are extracted from video segments, the
presentationTimeOffset of the video segment should be applied to the
extracted captions, as well.
Fixes b/70902665
Change-Id: I446333a14b8b6374786ab594a579b6e18bc73ac1
There we a couple different fake text displayers in our tests. This CL
take them all and consolidates them into one fake text displayer.
Change-Id: I889aa4f11660d641920b0628e7e91549cb715c6a
In our tests we regularly have checks that repeatedly check if a
function/spy has been called once more. To check this we would check
the call and then reset the calls each time.
To abstract this out, this CL defines two custom jasmine matchers that
allow us to check if a function/spy has been called once more.
To validate the matchers, TextEngine tests were update to make use of
it.
Change-Id: Ia6bf8d0a585648126881e1713b35be674bd47ba7
This reverts commit c38d4dd8d3, which
actually broke text range calculations in v2.3.10, and v2.4.2-v2.4.4.
The original commit was meant to account for the period start, but
resulted in a double-accounting of presentationTimeOffset.
The start and ends times passed into TextEngine's appendBuffer were
period-relative, so timestampOffset had already been applied. To
avoid further confusion and to fix the original issue the reverted
commit tried to address, these have been changed to
presentation-relative timestamps. Now the period start and all
offsets have been accounted for before the metadata reaches
MediaSourceEngine and TextEngine.
The tests added in the bad commit have been modified to test for the
opposite: that we do not erroneously account for timestamp offset when
calculating the buffered ranges for text.
Closes#1562
Change-Id: I9fa7a3f59906c4f3e623f411e48551f86f5c2ff7
For multi-Period content, we need to account for the timestamp offset
in the buffered range calculation since the start/end times are
given as Period-relative.
Change-Id: I6d32de2abc316918333b1c58ba73c71d028284c4
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
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: I6a329d28e13a81c9f7136737518c6bb8fa18402e
We incorrectly added the presentationTimeOffset to the segment times as
a fix for #1164. The correct fix is to use the include the PTO in the
time structure passed to the text parsers. This is a partial revert
of 207505.
Issue #1164Closes#1232
Change-Id: I1f2805e0dbdc44be71e2160b3d37a73732c97a4f
This avoids having media from one period replaced by media from the
next period. Instead, media that comes before the period start will
be chopped off by MediaSource.
Closes#1098
Change-Id: Idf6dc2ffafe78214e94bc75aca63920e153f1a2c
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
This is part of adding a new conformance rule to add additional type
safety. This will disallow using properties of unknown types or using
unknown properties.
The first parts will be fixing errors caused by the new rule. These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.
Change-Id: Ic37437a1ad2305bc50a814cdcc562e74703222ac
The old definition using a union with a Function causes problems. The
compiler tends to treat this as an unknown type, so we loose type
safety. The new types ensure full type safety, at the cost of needing
to "convert" the spy when it is used as a function.
Change-Id: I98ebd9dffd9cb865d0cf5d03db0fb5d6ea001ed3
This change creates a lib/text directory and moves all files
with text-related logic to it. It also lays the ground for
separating text parsing and display logic. (That change will
introduce even more files with text-related logic which will
crowd lib/media directory).
Issue #796.
Change-Id: I65ac134020a0126ff02a8f2067beb73870232e65