React-native-track-player: setRate() is not sync with notification centre's duration and current time value

Created on 20 Jan 2021  路  3Comments  路  Source: react-native-kit/react-native-track-player

Screenshot 2021-02-02 at 4 35 23 PM

Bug Needs Confirmation

All 3 comments

Also noticing this when the playback rate is below a certain threshold

@krunalbad There's a number of things I've noticed.

  • It appears to me that setRate() must be called _every_ time another operation happens on the track player: play, pause, next, skip.
  • I've noticed that not only that but you must also use pause() then re-trigger the rate setRate() and then call play() again in order to get the Notification Player and UI Player to sync up, otherwise the Notification Player resets its rate to 1x. It seems to me like pause MUST be called to trigger the "remote/notification" state when updating the rate in the UI.
  • Lastly, I've found that I had to add a pitchAlgorithm, otherwise the ratio of speed between the the Notification Player and UI Player were slightly different in which the lag was compounded depending on the length of the track.
  • One other thing just to take note of is that setRate accepts floats like .1.6 but you'll notice if you console log getRate() after setting it, that the value isn't 1.6, but rather 1.600000023841858. If using state management probably best to store the value of getRate() rather than using a value from a variable like 1.6, but really shouldn't affect the experience either way.

Does it work for you? I have tried this but the issue is still persisting for me 馃槥
If possible can you share with me your piece of code of setupPlayer and updateOptions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JakeMotta picture JakeMotta  路  3Comments

mnlbox picture mnlbox  路  4Comments

curiousdustin picture curiousdustin  路  4Comments

EhteshamAnwar picture EhteshamAnwar  路  3Comments

ManrickCapotolan picture ManrickCapotolan  路  4Comments