Closed
Description
[REQUIRED] Use case description
Current implementation of HlsMediaSource
starts with default position:
We attempt to set the default start position to be at least twice the target duration behind the live edge.
So, if HLS has lots of segments or they are long enough - default start position will be pretty far from it's 0. This is desired behavior when playing "live" media.
But, for example, "catchup" of IPTV services is implemented in the way, when url identifies specific time (wall clock), and when player starts playback - it should start from 0 instead of "live edge" to match target wall clock.
Alternatives considered
I have tried:
MediaItem.ClippingProperties
- does not work (since it clips only)- seeking before preparations (How to load stream in the desired position? #2197) - does not work
Proposed solution
I have tried:
- custom media source + custom timeline, which forces
Window.defaultPositionUs
(based on Allow the app to override the start position when playback transitions to another source #2403 (comment)) - works
I think that some functionality can be provided by library itself:
- fully functional
CustomStartPositionSource
- or at least easy-to-extend delegating media source. Otherwise
CompositeMediaSource
should be used (the same as it's used byClippingMediaSource
), which looks a bit of overkill.