A more progressive Loading Bar for HTML5

  • Hello all,

    I am trying to implement a loading bar for single spherical images. These images tend to be large (+-3MB), so downloading on a phone would take some time. I can show a spinner, to indicate that 'something' is downloading or busy, but it would be perfect if there was a progression bar showing 'how much' has already been downloaded.

    In my research, I found out that the flash version of krPano shows a progressive download bar, whereas the HTML does not. See the difference in both examples, and the smoother progression for the flash version (the html version seems to only count howmany cubical sides have been downloaded):

    https://krpano.com/examples/117/e…ml?html5=prefer

    https://krpano.com/examples/117/e…tml?html5=never

    (notice the html5 parameter in the url)

    Has anyone else got a better progression loading bar for html5?

    My code so far (which should be used as an include, eg: <include url="%SWFPATH%/include-loading.xml" /> ):

  • Hi,

    the reason is that HTML5 doesn't have a 'progress' event for loading images, so it could count only the files.

    The only solution would be loading the images as binary data (via xmlhttprequest) and then decoding it later, then it would be possible to track the loading progress, but than the loading would be slower and would require more memory - and that's a bad trade-off for a smoother progress bar...

    Best regards,
    Klaus

  • Ok, got it.

    A further question here about my code above. I can see that, for the flash version, there is already a loading bar displaying when the scene changes. I would like to remove it (and place it with my own styled loading bar). OR, I would like to know when the built-in loading bar is displaying, so that I dont display mine.

    How can I do that?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!