From d930ae3e9ee5383a293ab08b83844e054c22cb0b Mon Sep 17 00:00:00 2001 From: Vadiraj Karanam <90848631+VadirajKranam@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:39:23 +0530 Subject: [PATCH] Update SongSlider.jsx added onValueChange prop in Slider with a callback function so that when user forwards the track with slider, track plays from the duration where user wants to play from.[Its a bit difficult to explain in text :)] --- spotifymusic08/src/components/SongSlider.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spotifymusic08/src/components/SongSlider.jsx b/spotifymusic08/src/components/SongSlider.jsx index cc5c571..31ae568 100644 --- a/spotifymusic08/src/components/SongSlider.jsx +++ b/spotifymusic08/src/components/SongSlider.jsx @@ -1,7 +1,7 @@ import Slider from '@react-native-community/slider'; import React from 'react' import { View, StyleSheet, Text } from 'react-native'; -import {useProgress} from 'react-native-track-player' +import TrackPlayer,{useProgress} from 'react-native-track-player' const SongSlider = () => { const {position, duration} = useProgress() @@ -10,6 +10,10 @@ const SongSlider = () => { { + await TrackPlayer.seekTo(change) + } + } minimumValue={0} maximumValue={duration} thumbTintColor='#FFF' @@ -47,4 +51,4 @@ const styles = StyleSheet.create({ }, }); -export default SongSlider \ No newline at end of file +export default SongSlider