Enable background controls for iOS

This commit is contained in:
Lei Nelissen
2020-06-16 21:41:02 +02:00
parent 50dd06a473
commit 2b35362272
7 changed files with 63 additions and 9 deletions

View File

@@ -23,10 +23,12 @@ const Container = styled.View`
const Buttons = styled.View`
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
`;
const Button = styled.View`
margin: 20px;
margin: 20px 40px;
`;
export default function MediaControls() {

View File

@@ -18,16 +18,11 @@ const Artwork = styled.Image`
export default function NowPlaying() {
const track = useCurrentTrack();
// GUARD: Don't render anything if nothing is playing
if (!track) {
return null;
}
return (
<View style={{ alignItems: 'center' }}>
<Artwork style={{ flex: 1 }} source={{ uri: track.artwork }} />
<Text style={{ fontWeight: 'bold', fontSize: 24, marginBottom: 12 }} >{track.artist}</Text>
<Text style={{ fontSize: 18, marginBottom: 12, textAlign: 'center', paddingLeft: 20, paddingRight: 20 }}>{track.title}</Text>
<Artwork style={{ flex: 1 }} source={{ uri: track?.artwork }} />
<Text style={{ fontWeight: 'bold', fontSize: 24, marginBottom: 12 }} >{track?.artist}</Text>
<Text style={{ fontSize: 18, marginBottom: 12, textAlign: 'center', paddingLeft: 20, paddingRight: 20 }}>{track?.title}</Text>
</View>
);
}