0

I made a custom video controller where I want to be able to seek by dragging the marker the seek bar. In my desktop chrome browser I get a smooth(ish) playback of the current video position as I drag the slider around. On my Android device (in a Webview on a hybrid app) the video position doesn't update until I release the slider.

I took this further by making my own slider so that I could control the input to the video elements currentTime setter. I found that if I rounded the input to an integer value I would get live updates as I dragged my own slider around. But of course, they were not smooth at all as it jumps between integer seconds.

Anyone got ideas?

Alexander Soare
  • 2,825
  • 3
  • 25
  • 53

1 Answers1

1

Most likely it differs how the seeking is handled on both platforms - since a compressed video stream contains seek points (keyframes), and search to any given time point happens by seeking to the closest seek point back from the time you are seeking to and then decoding the frames up to the time you seeked to. Since it is a hybrid view, maybe the underlying implementation is faulty, and simply jumps to the closest keyframe and stays there, but does not actually decode up to the requested time.

A trivial check for this would be to produce a video with all keyframes and the check the behavior - if now the behavior between desktop browser and you hybrid view does not differ, this should be the issue, and you should ask the authors of the framework about this.

There are several questions here (this, this). I am not sure if ffmpeg allows 0 for the keyframe interval so check that out.

Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71