How to use the react-native-track-player.seekTo function in react-native-track-player

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

github m-inan / react-native-music-app / src / Scenes / Player / Slider.js View on Github external
onPanResponderRelease: () => {
			// end
			TrackPlayer.seekTo((duration / 100) * percent)

			setMoveSlider(false)
		},
		onPanResponderGrant: ({ nativeEvent: { locationX, locationY } }) =>
github m-inan / react-native-music-app / src / reducers / Player / handler.js View on Github external
TrackPlayer.play()
			break
		case 'remote-pause':
			TrackPlayer.pause()
			break
		case 'remote-stop':
			TrackPlayer.stop()
			break
		case 'remote-next':
			TrackPlayer.skipToNext()
			break
		case 'remote-previous':
			TrackPlayer.skipToPrevious()
			break
		case 'remote-seek':
			TrackPlayer.seekTo(data.position)
			break
		case 'remote-duck':
			TrackPlayer.setVolume(data.ducking ? 0.5 : 1)
			break
		case 'playback-state':
			dispatch(playbackState(data.state))
			break
		case 'playback-track-changed':
			dispatch(playbackTrack(data.nextTrack))

			break
		case 'playback-queue-ended':
			// finish

			break
		case 'playback-error':
github moonou / siren / src / views / Play.js View on Github external
onSlidingComplete={(value) => {
              console.log(value, value * this.state.duration)
              TrackPlayer.seekTo(value * this.state.duration)
            }}
            buffering={this.getBufferedProgress()}
github Musicoin / app / components / Player.js View on Github external
async onQueueEnded(data) {
    console.log(data);
    if (data.track && data.position != 0) {
      if (this.props.settings.repeat) {
        await TrackPlayer.seekTo(0);
        await TrackPlayer.play();
      } else {
        this.playNextTrack();
      }
    }
  }
github PierreBresson / Thinkerview / app / event-handler.js View on Github external
TrackPlayer.addEventListener("remote-jump-backward", () => {
    TrackPlayer.seekTo(data.position - 15);
  });
github m-inan / react-native-music-app / src / provider / service.js View on Github external
TrackPlayer.addEventListener('remote-previous', async () => {
		const time = await TrackPlayer.getPosition()

		if (time <= 3) {
			TrackPlayer.skipToPrevious()
		} else {
			TrackPlayer.seekTo(0)
		}
	})
github PierreBresson / Thinkerview / app / components / progressBar.js View on Github external
          onValueChange={value => TrackPlayer.seekTo(value)}
        />