How to do it...

  1. Let's start by opening up App.js and adding the dependencies we'll need:
import React, { Component } from 'react';import { Audio } from 'expo';import { Feather } from '@expo/vector-icons';import {  StyleSheet,  Text,  TouchableOpacity,  View,  Dimensions} from 'react-native';
  1. An audio player needs audio to play. We'll create a playlist array to hold the audio tracks. Each track is represented by an object with a titleartistalbum, and uri:
const playlist = [  {    title: 'People Watching',    artist: 'Keller Williams',    album: 'Keller Williams Live at The Westcott Theater on 2012-09-22',    uri: ''  },  { title: 'Hunted By A Freak', ...

Get React Native Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.