0

I am using React Native Track Player version 3.2. Everything is working properly in Android when I am using local media path instead of the website media url. I am also not getting any error in the log.

Here is my TrackPlayer.add snippets as follows:

Previously:

await TrackPlayer.add([
    {
      id: '1',
      url: require('./assets/demo.mp3'),
      title: 'Modern Chillout',
      artist: 'penguinmusic',
      duration: 66,
    },
  ]);

Replaced with URL:

await TrackPlayer.add([
    {
      id: '1',
      url: 'https://file-examples.com/storage/fef677cdf46481c8d96f8cd/2017/11/file_example_MP3_700KB.mp3',
      title: 'Example',
      artist: 'Example',
      duration: 27,
    },
  ]);

I am following everything that has been documented in website. Do I need to change anything within the android folder? I am using Windows, so I haven't checked whether it will work in IOS or not. Any help will be highly appreciated.

1 Answers1

0

Could not get your example song to work, but my own example song plays fine, so maybe try another link.

This is the song i use for testing:

 await TrackPlayer.add([
    {
        id: '1',
        url: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
        title: 'Fluidity',
        artist: 'tobylane',
        // duration: 372,
    },
])