Search code examples
androidhtml5-videovideo.js

Video.js seeking is off by about 5-10 seconds on Android devices


The subject pretty much sums it up. We have a custom player built on top of Video.js, with a "chapters" menu that allows users to jump to particular parts of a video using the Video.js api, aka:

video.currentTime(newValue)

This works great on most devices (with a discrepancy of just about 1/2 a second or less), except on Android (specifically testing on a Galaxy S5) it tends to result in the video jumping 5 - 10 seconds earlier into the video than specified i.e. if I do video.currentTime(30) the video starts playing at 24 seconds.

Any ideas?!


Solution

  • Unfortunately on most Android devices the video jumps to the next or previous keyframe. Try to convert the video with ffmpeg using -force_key_frames option.