Preload API
See original GitHub issueWe should have an API to allow an application to pre-load a manifest and some of the media segments without involving MediaSource
or a <video>
element. An application could speculatively pre-load the beginning of several pieces of content while the user is making a decision. That content could then begin playing almost instantly.
This requires some redesign. Currently, new Player()
requires an HTMLMediaElement
, and the load()
pipeline connects from manifest parsing all the way to streaming and MediaSource
. These things would need to be decoupled, and a new preload()
method would have to be introduced.
Note, though, that if we had it today, this new preload()
method would not be usable from a service worker just yet, because our DASH manifest parser depends on DOMParser
for XML parsing, and DOMParser
is not available in a service worker.
Until manifest parsing can be done from a service worker context, operations involving a manifest must be done from the page context.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:39 (30 by maintainers)
Hi everyone,
Our design for Preload API is posted for review. Please take a look and let us know if you have any questions, comments or suggestions. Thank you!
Yes, this will generally work, but the are some limitations like managing autoplay restrictions on video elements, or devices that support only one video element at a time(smart TVs, cast device etc) Having such an api to load the data and possibly storing it in an array of array buffers and feeding it to a source buffer that will be attached to only one vide element will enable support across platforms with different limitations.