Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
Video.js bug when skipp video. Progress bar stoping before end

I have a strange bug with Video.Js When I am skipping video with my skip controls I do get such strange bug:

enter image description here

My skip forward looks like this: playerRef.current?.currentTime(playerRef.current?.currentTime() + 10);

REst of my code for player init is based on Video.js docs

 const videoRef = useRef<HTMLVideoElement | null>(null);
  const playerRef = useRef<VideoJsPlayer | null>(null);
  const [pause, setPause] = useState(playerRef.current?.paused() ?? true);

  useEffect(() => {
    // make sure Video.js player is only initialized once
    if (!playerRef.current) {
      const videoElement = videoRef.current;
      if (!videoElement) return;

      const player = (playerRef.current = videojs(videoElement, options, () => {
        /* video.js pause play control */
        player.on('pause', function () {
          setPause(true);
          playerPause && playerPause(true);
        });
        player.on('play', function () {
          setPause(false);
          playerPause && playerPause(false);
          playerLive && player.liveTracker.seekToLiveEdge();
        });
        player.on('ended', function () {
          setPause(true);
          playerPause && playerPause(true);
        });
      }));
    } else {
    }
  }, [options]);

  // Dispose the Video.js player when the functional component unmounts
  useEffect(() => {
    return () => {
      if (playerRef.current) {
        playerRef.current.dispose();
        playerRef.current = null;
      }
    };
  }, []);

I was trying to check how much is remainig and than if it is lower than 10s, skip only remaing time, but still this did not helpe

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!