Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions spotifymusic08/src/components/SongSlider.jsx
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -10,6 +10,10 @@ const SongSlider = () => {
<View>
<Slider
value={position}
onValueChange={async (change) => {
await TrackPlayer.seekTo(change)
}
}
minimumValue={0}
maximumValue={duration}
thumbTintColor='#FFF'
Expand Down Expand Up @@ -47,4 +51,4 @@ const styles = StyleSheet.create({
},
});

export default SongSlider
export default SongSlider