tags:

views:

374

answers:

2

Hello,

Almost every flash player has an option to display how much of buffer (or % of total video) is downloaded to the client. At the moment I don't see it in any implementation of html5 video player.

The real problem I am trying to solve is to have a way of knowing % of downloaded asset (image/swf/video whatever). In flash its easy by using MovieClipLoader and bytesLoaded property.

Is there any way of doing it in HTML/HTML5/Javascript (without relying on Flash) ?

Thanks!

+1  A: 

See the buffered property but be aware that there are (as far as I know) no complete implementations of the HTML 5 video API, and that it is subject to change anyway, so browsers which support other parts of the spec may not support buffered.

David Dorward
Yep, that's the right (only) way to do it. However, in Opera we always return an empty range and there is no way to find out how much has been buffered (in seconds or bytes). Will be fixed eventually.
foolip
Thanks! I have missed that. Will be checking on support for this. On the iPhone at the moment it seems videos are played outside of the Safari browser so there is no way to pass that info with javascript back to the page.
Janusz
A: 

A workaround may be in some cases to make a container swf that will load your flash movie in it and act as a preloader. In every iteration of your flash preloader call a javascript function . You will pass to this function the percentage of bytes being loaded and then you can handle it however you want. Of course there are some limitations in this but maybe it will give you some ideas.

Gar
his question is about HTML5 not Flash
fuzzy lollipop