We evict SegmentPrefetched on each streaming engine update, in the case
of Live, it may happen that we are on the Live edge and do not have
segments, but we want to avoid the initialization segment being
downloaded again in the future when it is not necessary.
fastSwitching can be used in case there is a need to start linear
playback at very low delay (e.g. shortly after the time the client
acquired MPD, initialization segments, and DRM license) or to switch
from ad content to main content at an arbitrary point in the stream.
As an example, two representations, join6_540p and join6_1080p, have
6-frame GOPs and are used to start playback at a 6-frame boundary. This
enables start-up and fine-grain random access at any 6-frame boundary.
fastSwitching are aligned with the “normal” adaptation set. Asa result,
it it is possible to switch between “normal” and fastSwitching variant
at any segment sequence boundary.
---------
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
Adds a replacement for removed JSDoc checks from ESLint v9.
Additionally fixes lots of issues found in the JSDoc, such as:
- missing `@param`/`@return` annotations
- bad formatting
- params order
- param name in the same line as type definition (tried to disable it,
but it was causing other issues and we didn't have lots of places with
such formatting)
Minor fixes in code found by Closure Compiler after fixing JSDoc are
also included.
Previously, the PreloadManager would consider a preload "finished" after a few major files like the manifest had been preloaded. It would start prefetching some segments, but wouldn't wait on it to notify the developer.
This PR changes the PreloadManager so that
PreloadManager.waitForFinish won't return until the prefetched segments have finished loading.
Because of that, this also better surfaces errors thrown during segment prefetching, when preloading.
Issue #7520
Starts caching `SegmentIterator` in `SegmentPrefetch` to avoid creating
new one on every update. Previous behavior was more time-consuming &
could cause issues on platforms with precision problems, like Xbox.
Adds a new player method, preload. This asynchronous method creates a PreloadManager object, which
will preload data for the given manifest, and which can be passed to the load method (in place of an asset URI)
in order to apply that preloaded data. This will allow for lower load latency; if you can predict what asset will
be loaded ahead of time (say, by preloading things the user is hovering their mouse over in a menu),
you can load the manifest before the user presses the load button.
Note that PreloadManagers are only meant to be used by the player instance that created them.
Closes#880
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
A recent change made it always log that segments were re-used, but in
reality there were times when they were missed. Uses the language from
the original PR