question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

player.seek() is not accurate

See original GitHub issue

Current behavior

I’m trying to show a trimmed video by limiting currentTime in onProgress event. But when the video reaches a limit and I seek to the start time of trimmed video, player.seek(startTime) goes to the wrong position (slightly before the given time). for example If I seek to 1.79323 it seeks to 1.63343!

Reproduction steps

Just seek to a time and watch the play position

Expected behavior

It should seek to the desired time

Platform

Which player are you experiencing the problem on:

  • iOS

Version

React Native 0.54.7 react-native-video 4.3.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:10

github_iconTop GitHub Comments

6reactions
geroalecommented, May 2, 2020

Same issue on Android: it has an error of almost 6 seconds after seeking. accuracy parameter in player.seek doesn’t work.

1reaction
Abdullah1428commented, Jan 20, 2021

I needed to show the exact time of the video to the user according to the sliding of the trim slider. I was facing a similar issue and I got to manage a workaround in my case. I hope it’s helpful to anyone facing a similar issue.

const [check, setCheck] = useState(true)
onProgress = {onProgress}

const onProgress = ({currentTime}) => {
    if (Math.round(currentTime) === 0 && checked) {
      if (player) {
        player.current.seek('jump to your desired value');
        setChecked(false);
      }
    }

   if (Math.round(currentTime) > 0) {
      if (checked) {
      } else {
        setChecked(true);
      }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

player.seek() is not accurate · Issue #1550 · react-native-video ...
Current behavior​​ I'm trying to show a trimmed video by limiting currentTime in onProgress event. But when the video reaches a limit and...
Read more >
AVPlayer seek not always accurate - Stack Overflow
1 Answer 1 · Tolerance uses CMTime , would I just init like : let tolerance = CMTimeMake(value: 1, timescale: 1) ? ·...
Read more >
seek(to:) | Apple Developer Documentation
Requests that the player seek to a specified time with the amount of accuracy specified by the time tolerance values, and to notify...
Read more >
Wix Video Player Not Working for YouTube Videos - .seek()
I have a problem which is not understandable from my side because 1 month ago I used same codes and everything was working...
Read more >
YouTube Player API Reference for iframe Embeds
Embed a YouTube player in your application. ... done = true; ... The player does not request the FLV until playVideo() or seekTo()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found