w3c / media-source

Media Source Extensions
https://w3c.github.io/media-source/
Other
267 stars 57 forks source link

confusion on coded frame eviction algorithm / QuotaExceededError when preloading #231

Open jpiesing opened 5 years ago

jpiesing commented 5 years ago

An app wants to preload as much of a piece of media as possible before playing.

A naive reader might expect that the app can just keep calling appendBuffer() from the beginning of the piece of media working along the media timeline until a QuotaExceededError is thrown.

The description of the coded frame eviction algorithm suggests that QuotaExceededError might never be thrown and an implementation could just evict unplayed data from earlier on the media timeline. An app could just keep appending data until all the piece of media has been appended but then the app would then have the end of their piece of media in the SourceBuffer rather than the start which is not useful.

Is this interpretation of the coded frame eviction algorithm correct?

Is there any spec-based way around this or would the developer just have to test their target population of implementations (including devices) and find out how much data can be preloaded & if a QuotaExceededError is thrown?

JohnRiv commented 3 years ago

Noting that this is of interest to CTA WAVE

wolenetz commented 3 years ago

Information about this in the spec, at least non-normatively, would assist API users. This seems to me to be at least a spec bugfix in scope for V2. See also #232, which may include language in the spec that assists solving this issue, too.