Bug 265023
| Summary: | [MSE] Change canPlayThroughRange to check buffered data at the current position | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Enrique Ocaña <eocanha> |
| Component: | Media | Assignee: | Enrique Ocaña <eocanha> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | jer.noble, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=270050 | ||
Enrique Ocaña
The current SourceBuffer::canPlayThroughRange() implementation is based on average buffering rate. While this approach makes sense in a context of continuous playback, where the JS app is always trying to append data, this isn't always the case in some real life apps. For instance, an app may append a lot of data on page load (enough for sustained playback), then decide to wait for whatever reason, and then start playback. In those circumstances, wait would cause the average buffering rate to be artificially low. There are more examples of the kind of problems that a time-based/average buffering rate-based approach may cause.
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/928
One solution would be to use Firefox strategy to this problem[1]: if the ranges to be checked have 3 seconds or more buffered after the current position, we consider that sustained playback is possible. This solves the issues seen in some real world apps.
If this approach causes any problems on non-WPE/WebKitGTK ports, a possible improvement might be to let the platform implementation decide the desired strategy in some way. For the mentioned platforms it's important to get rid of the problems that the time-based implementation causes.
[1] https://github.com/mozilla/gecko-dev/blob/master/dom/media/mediasource/MediaSourceDecoder.cpp#L320
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Enrique Ocaña
Pull request: https://github.com/WebKit/WebKit/pull/20663
Radar WebKit Bug Importer
<rdar://problem/118770174>
EWS
Committed 272762@main (c55cda1034c1): <https://commits.webkit.org/272762@main>
Reviewed commits have been landed. Closing PR #20663 and removing active labels.