KRPano Video Player seek functionality making multiple api calls to seek video

  • Hello team,


    Currently we are running into an issue with the video seek functionality of KRPano.


    We are loading video into KRPano by passing a URL. We have used KRPano in the past with in-built seek bar functionality. Trying to seek on the video works as expected without making any more calls to the URL than the initial one to load the video.


    Now we have created a custom seek bar external to the KRPano player component. When using this seek bar, we call the JavaScript API function of the KRPano component seek(someTime). Every time we invoke the seek function, KRPano makes new call to the URL with a range request, even though the entire video has already been fetched by the KRPano component.


    The repeated calls to fetch portions of the video is making the application very slow overall. How can we avoid making all of these extraneous calls? Is there a different JavaScript API function to use instead of seek, or some missing parameter we should be using that doesn't trigger the KRPano to make a call for a video that it should already have?


    On a different topic, is there a strategy for presenting a video file URL to KRPano without playing the video, sort of like loading the video "in the background"? We are attempting to start loading a video into the player before a user might have cause to see the video so that when the user is ready to see the video, they will not have to wait for the video to start buffering.

    Thank you,
    Rushi Thakkar

    Edited 3 times, last by rt10 (February 4, 2022 at 4:56 PM).

  • Hi,

    sorry, but there is a misunderstanding - the krpano viewer isn't loading the video by itself, that's all done by the browser. It's just HTML5 video.

    Loading a video means setting the 'src' of a HTML5 video object and seeking means setting the 'currentTime' playback position.

    For more internals have a look at the 'Open Source' version of the videoplayer plugin:
    https://krpano.com/plugins/videoplayer/#opensource

    Plugin source:
    https://krpano.com/viewsource.htm…basic_source.js

    About too many 'range requests' - that probably depends on the actual video encoding itself, e.g. have you used the 'faststart' flag during video encoding to move the headers to the front of the file? With that the browser doesn't need to use range requests to load first some information from the end of the video file.

    Best regards,
    Klaus

Participate now!

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