1. Change package name (rm "datasource")
2. Require injection of OkHttpClient through all constructors, and
remove allowCrossProtocolRedirect/connectTimeout/readTimeout
constructor arguments. The client should be configured with these
prior to injection.
3. Fix code style to be consistent with the project.
4. Simplify call to get contentLength. I'm pretty sure okhttp returns
the correct value when gzip is enabled, so there's no need to check
this in the data source.
5. Misc cleanups.
This change keeps the proportion offset * 256 as a floating point value rather
than rounding it before linear interpolation, which will increase precision
slightly when seeking in streams with XING headers.
In practice, this won't make much of a difference because precise seeking in VBR
MP3s with XING headers seems not to be possible without reading the entire file,
due to the fact that the (uneven) distribution of bits is represented by a fixed
number of table of contents entries.
- The old approach was technically incorrect, because the checks
were "capacity < sampleSize" and hence neglected the fact that
the buffer position may be greater than 0 (e.g. if the caller
wants to prefix the sample with some additional data).
- Also proactively throw an exception if the buffer is too small,
rather than wait for the failure when we actually do the write.
- Line parameter
- Added support for value and line alignment attributes.
- Support negative numbers when line is an absolute number (not a
percentage).
- Position parameter
- Added support for value and position alignment attributes
- Added support for WebVTT comment blocks
- Percentage values now accept decimal numbers (as webvtt spec states)
- Added new WebVTT tests for testing all new implemented features
- do not denormalize styles at parsing time but only put normalized style info
into TtmlNode tree. Resolve styles on demand when Cues are requested for a
given timeUs.
- create TtmlRenderUtil to have static render functions separate
- added unit test for TtmlRenderUtil
- adjusted testing strategy for unit test to check resolved style on Spannables after rendering