[webkit-help] Changes to progress events?
Eric Carlson
eric.carlson at apple.com
Wed Dec 2 08:09:40 PST 2009
Sjoerd -
On Dec 2, 2009, at 7:19 AM, Adam Roben wrote:
> On Dec 2, 2009, at 5:43 AM, Sjoerd Tieleman wrote:
>
>> I am building an experimental HTML5 video player and I was relying on ProgressEvents to determine how much of the video had been loaded and display a progress indicator. It seems that in recent builds of Webkit these events are no longer ProgressEvents, but rather generic Events with type "progress". They no longer contain the "loaded" and "total" attributes. Is this an intentional change?
>> Current versions of Safari fire "ProgressEvents", but the latest Webkit nightlies fire "Events".
>
> Yes, this is intentional, and reflects a change in the HTML5 specification. See <https://bugs.webkit.org/show_bug.cgi?id=30513> for details.
>
You can display download progress with the media element's 'buffered' [1] and 'duration' [2] properties. I believe that a progress display based on these properties is more accurate in any case, because 'loaded' and 'total' referred to byte offsets in the media resource and not all media files have a constant bit rate.
eric
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-buffered
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-duration
More information about the webkit-help
mailing list