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
but this makes no difference. Also events like
were apparently removed in iOS8, so not sure how you're calculating it!
ANY HELP - Would be greatly appreciated.
<plugin name="video" url.flash="/viewer/plugins/videoplayer.swf" url.html5="/viewer/plugins/videoplayer.js" videourl="video_large.mp4" videourl.mobile="video_small.mp4|/videos/video_sound.mp3" pausedonstart="true" loop="false" volume="1" onvideoready="triggerLoading(); checkLoadingProgress();"/>
<action name="triggerLoading"> <!-- This play/pause trigger, is to ensure that on mobile, it begins loading --> plugin[video].play(); delayedcall(pauseDelay, 1, plugin[video].pause() );</action>
<action name="checkLoadingProgress"> showlog();
copy(loadedB, plugin[video].loadedBytes); copy(totalB, plugin[video].totalBytes);
Math.floor(loadedB); Math.floor(totalB);
div(averageB, loadedB, totalB);
trace(averageB);
if(averageB == 1, trace("DONE!"); );
<!-- Keep looping until it's done! --> delayedcall(checkLoaded, 1, checkLoadingProgress()) );
</action>
Display More