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/HTML开发者_运维技巧5/Javascript (without relying on Flash) ?
Thanks!
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.
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.
精彩评论