O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Playing audio files on iOS

With the iPod and the digital music revolution, a digital portable media device became a must-have for even the most casual music listeners. The smartphone has superseded the media device, with many users storing large music libraries on their phones. It is only natural for other applications to want to access the music library.

In this recipe, we will create a native module to show the iOS mediaPicker and then select a music file to play. The file will play through the iOS native media player, allowing the music to play in the background and be controlled by the iOS control center.

Getting ready

For this recipe, we created a React Native application titled AudioPlayer.

In this recipe, we will use the react-native-button ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required