react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

Can't play from firebase url.

Open ArjunKarki opened this issue 2 years ago • 1 comments

can't play url from firebase. My link is https://storage.googleapis.com/chat_bucket_aso/2ihzd1mklbl8pwvhsw_3.36.mp3 My code const audio = new Sound( message.audio, null, error => { setLoadingAudio(false); if (error) { console.log('failed to load the sound', error); setError(true); } }, );

ArjunKarki avatar Oct 01 '22 14:10 ArjunKarki

@ArjunKarki wrap your audio file url into decodeURIComponent() function.

const audio = new Sound(
  decodeURIComponent(message.audio),
  null,
  error => {
    setLoadingAudio(false);
    if (error) {
      console.log('failed to load the sound', error);
      setError(true);
    }
  },
);

nHussain18 avatar Apr 19 '23 03:04 nHussain18