How to use the react-native-music-control/index.ios.js.updatePlayback function in react-native-music-control

To help you get started, we’ve selected a few react-native-music-control examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yuche / gouqi / src / sagas / player.ts View on Github external
export function* watchStatus ({ payload: {status} }: any) {
  const { currentTime } = yield select(playerStateSelector)
  if (status === 'PLAYING') {
    yield fork(MusicControl.updatePlayback, {
      state: MusicControl.STATE_PLAYING,
      elapsedTime: currentTime
    })
  }
  if (status === 'PAUSED') {
    yield fork(MusicControl.updatePlayback, {
      state: MusicControl.STATE_PAUSED,
      elapsedTime: currentTime
    })
  }
}