iOS8 loadedBytes - Preload video (Issue)

  • Hi there,

    I've just bought the commercial license for KRPANO, it's great!

    I'm working on a 360 HTML5 video Panorama project which requires I pre-load the entire video. I'm able to do this successfully on Desktop, but on mobile it's a little flaky.

    The idea:
    When a user clicks "Play", I'm loading the scene (code below), and I trigger a play/pause. This ensures that the video begins downloading data. When the video is done loading, I can then proceed to load other assets (hotspots, content etc..)


    The issue:

    On iOS 8.1.3, It begins loading fine (after user interaction), however at random points, the video "loadedBytes" stop reporting back. It just get's stuck.
    I might get to 40%, 27%, 95%... It's not a repeatable point at where it stops.

    I'm testing over WiFi and 4G to compare.
    I'm also testing with multiple video resolutions (and pixel sizes), ranging from 15MB to 40MB.

    Thoughts:
    I feel as though if the initial download "burst" is fast enough, it MIGHT be able to pre-load the video using this method before the issue occurs.
    However I'd love to know more about how loadedBytes works. I've spent time researching the HTML5 media API and have also tried accessing the object directly via

    Code
    get("plugin[video]").videoDOM

    but this makes no difference. Also events like

    Code
    progress

    were apparently removed in iOS8, so not sure how you're calculating it!


    ANY HELP - Would be greatly appreciated.

  • Hi,

    it's not possible to control the buffering of HTML5 video - that's up to the browser (and different from browser to browser). The browser might preload and buffer some seconds or some megabytes, but it's not possible to control that buffering.

    The krpano HTML5 videoplayer plugin uses the buffered information (when available) from the HTML5 video object to calculate a 'faked' loadedbytes value to allow (existing) xml scripts showing loading progress bars.

    See the HTML5 notes in the videoplayer documentation:
    https://krpano.com/plugins/videoplayer/#loadedbytes

    Best regards,
    Klaus

  • Thanks for the reply Klaus,

    I've been testing this now for 2 days, and you're right, it's quite quirky on all the different devices out there.

    I can at least use the "get("plugin[video]").videoDOM" to check the readyState, and make sure it equals 4 before continuing.


    Thanks

Participate now!

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