React-native-track-player: The position from the `useProgress` hook doesn't update while paused

Created on 9 Feb 2020  路  7Comments  路  Source: react-native-kit/react-native-track-player

Configuration

Run react-native info in your project and share the content.

System:
    OS: Linux 5.3 Ubuntu 19.10 (Eoan Ermine)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 521.25 MB / 15.49 GB
    Shell: 5.7.1 - /usr/bin/zsh
  Binaries:
    Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
    Yarn: 1.21.1 - /usr/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
  SDKs:
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom_64
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5

What react-native-track-player version are you using?

2.0.0-rc13

Issue

We use useProgress with functional component.
When player is paused and user seek to different position (TrackPlayer.seekTo) the position from the hook doesn't update until playback is resumed.

Most helpful comment

I have related issue, if I play a track, pause it, navigate away and navigate back useProgress returns 0.

2.0.0-rc12

All 7 comments

I have related issue, if I play a track, pause it, navigate away and navigate back useProgress returns 0.

2.0.0-rc12

in ios we can not find useProgress and this error happend
{"line":56,"column":58,"sourceURL":"http://localhost:8081/src/components/core/media/bottom_player.bundle?platform=ios&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true"}

We are experiencing the same issue as the OP. I would expect that the useTrackPlayerProgress hook would return the updated position immediately after invoking TrackPlayer.seekTo with a new position.

Try to pass 0 into useProgress; Like useProgress(0) :)

I'm struggling with this issue... if I pause then navigate away from the player screen when I navigate back to the player screen, the progress appears to be 0 until I play then it refreshes to the correct position... tried @dikobrazik suggestion but that didn't work 馃槥

also noticed that if i leave the track to play and navigate away from the player screen then come back to it.... the position is always 0 for a second or two before refreshing to the correct position.... I think these two issues are linked :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

toooldmohammad picture toooldmohammad  路  3Comments

JakeMotta picture JakeMotta  路  3Comments

moduval picture moduval  路  4Comments

EhteshamAnwar picture EhteshamAnwar  路  3Comments

tarahiw picture tarahiw  路  3Comments