react-nativereact-native-sound

Music Url not play in react native sound


I have facing an issues to play music url from react native sound i used Music url https://www.jiosaavn.com/song/mere-ghar-ram-aaye-hain/AVsuXSBBQWQ but when I try with .mp3 url it's working fine

please help me

const refTemp = useRef(null);

refTemp.current = new Sound(
         "https://www.jiosaavn.com/song/mere-ghar-ram-aaye-hain/AVsuXSBBQWQ",
          null,
          (error, sound) => {
            if (error) {
              alert('error: ' + JSON.stringify(error));
              return;
            }
            refTemp.current?.play(() => {
              refTemp?.current?.release();
            });
          },
        );

Solution

  • JioSaavn url is a web app url not actual audio url, that have in-build audio player uses audio streaming url, You can't use in place of audio file.

    You can also use JioSaavan Python API to convert song url to mp3 url that is useful to you.