Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method mmss returns incorrect values #633

Open
Alex-Vasilev opened this issue Sep 25, 2024 · 1 comment
Open

Method mmss returns incorrect values #633

Alex-Vasilev opened this issue Sep 25, 2024 · 1 comment

Comments

@Alex-Vasilev
Copy link

Please fill the template to help you out. Also, please try the Example project compare before submiting the issue when you have certain issue with your project setup.

Version of react-native-audio-recorder-player 3.6.10

Version of React Native 0.75.2

Platforms you faced the error (IOS or Android or both?) IOS (Android - ?)

Expected behavior eg 00:01, 00:02, 00:03 ....

Actual behavior 00:12, 35:24, 23:46...

Steps to reproduce the behabior use of the method

@camilossantos2809
Copy link

I'm having the same problem.
Using the code available in the docs to start playing and using the mmss function reproduces the behavior:

onStartPlay = async () => {
  console.log('onStartPlay');
  const msg = await this.audioRecorderPlayer.startPlayer();
  console.log(msg);
  this.audioRecorderPlayer.addPlayBackListener((e) => {
    this.setState({
      currentPositionSec: e.currentPosition,
      currentDurationSec: e.duration,
      playTime: this.audioRecorderPlayer.mmss(Math.floor(e.currentPosition)),
      duration: this.audioRecorderPlayer.mmss(Math.floor(e.duration)),
    });
    return;
  });
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants