Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 69e61b5

Browse files
committed
Add play/pause button to example
1 parent ed08a5b commit 69e61b5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

example/App.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export const App = () => {
1212
{ uri: 'track 2' },
1313
]);
1414

15+
const [isPlaying, setIsPlaying] = useState(false);
16+
1517
return (
1618
<SafeAreaView style={{ flex: 1 }}>
1719
<FlatList
@@ -39,6 +41,13 @@ export const App = () => {
3941
setTracks([...tracks]);
4042
}}
4143
/>
44+
<Button
45+
title={isPlaying ? 'Pause' : 'Play'}
46+
onPress={() => {
47+
// TODO: Play/pause
48+
setIsPlaying(prevIsPlaying => !prevIsPlaying);
49+
}}
50+
/>
4251
</View>
4352
</SafeAreaView>
4453
);

0 commit comments

Comments
 (0)