An accumulation of several fixes:
1. Change to HlsExtractorWrapper is just a move + documentating
things that were already true + adding a precondition in the
configureSpliceTo method.
2. Change in HlsSampleSource.readData ensures that configureSpliceTo
and hasSamples aren't called on an extractor that isn't prepared.
3. The other change in HlsSampleSource ensures the correct "previous"
TsChunk is used. If a TsChunk fails to load and is replaced, the
previous chunk should be the one before that whose load completed
successfully.
4. Determine switchingVariantSpliced based on the actual format of the
previous chunk, so it's set correctly in the case of a TsChunk load
failure and subsequent replacement.
This fixes the case where we need to switch from one variant to
another during preparation, having loaded zero samples, because
the first chunk for that variant gave us a 404 error. In this
case the first extractor will have no samples, and there will
be a second extractor that does.
There was a mess where we were indexing into both a list of variants
and a (differently ordered and possibly of differing length) list of
formats. This sanitises everything.
1. Refine the way TtmlNode handles whitespace collapsing when constructing
the output text. Can of worms.
2. Start using SpannableStringBuilder. This will allow attaching of spans
in getText as nodes are encountered, which is how we'll be incorporating
styling information into the result.
1. Remove requirement for TrackRenderer implementations to report
current position, unless they are time sources.
2. Expose whether renderers have media to play. The immediate benefit
of this is to solve the referenced GitHub issue, and also to only
display the appropriate Audio/Video/Text buttons in the demo app
for the media being played. This is also a natural step toward
multi-track support.
Github issue: #541
- Fix bug where duration of initially disabled tracks wasn't correctly
incorporated into the overall duration reported by the player.
- Don't transition to STATE_ENDED unless the position has reached the
duration, if the duration is known. This allows for "playback" to
continue when all renderers are disabled, rather than jumping straight
to STATE_ENDED.
- contentType can be defined on an AdaptationSet.
- language can be defined either in AdaptationSet or in a contained
ContentComponent.
- The id from the AdaptationSet should come from the AdaptationSet.
to if the playlist load fails.
NB - I'm aware the casting is a bit messy, but I don't want a common
interface because I'm hopeful that TsChunk will go away at some point.
Issue: #537
This makes it so that it's no longer necessary to specify the number
of downstream renderers to HlsSampleSource, FrameworkSampleSource and
ExtractorSampleSource, by forcing the downstream renderers to register
with the SampleSource instances in their constructors. This eliminates
a common source of subtle client bugs where the passed value is incorrect.
ChunkSampleSource had a null check solely for the VTT case,
where DashChunkSource wasn't setting a MediaFormat on VTT
chunks. It's trivial to do so, and is more consistent, so I've
done that and removed the null check. Also done some small
tidying.