I am using react-native-track-player for creating a music player. I am using Youtube API for audio streaming. Its give URL like
https://r2---sn-gwpa-w5py.googlevideo.com/videoplayback?expire=1612552132&ei=ZEMdYNnJDumPz7sPyrSLmAw&ip=49.36.246.217&id=o-AFQLS1cSUJ6_bXBjMOIiWk1NuIYTMUTVu4rmliPZmJCS&itag=251&source=youtube&requiressl=yes&mh=VD&mm=31%2C29&mn=sn-gwpa-w5py%2Csn-gwpa-qxaz&ms=au%2Crdu&mv=m&mvi=2&pl=21&initcwndbps=225000&vprv=1&mime=audio%2Fwebm&ns=nxhNYqBZK92ToigY08JRZjEF&gir=yes&clen=230633&dur=18.961&lmt=1524503096692151&mt=1612530050&fvip=2&keepalive=yes&c=WEB&n=UIc0qqVvrMQOjPVkP&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAObqQA5vFYy6rJ3O3J4zswofNj2NFZOrwMF05p_PgWg9AiAmnde3njBRfvPmW_2VVA0YO1aLWQl0V3STGayuqgBRKA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgFTqy7Ng9zxhQY4GM4vP1BooPeHOf50PTikb59C67voACIGDybTTJBdLkp9lUx_-ZLdCulG_y3TH6iMhBbAn1AZR_&ratebypass=yes
But the react-native-track-player not playing audio from this URL only on iOS it's perfectly working on Android
In iOS, the react-native-track-player requires URL with .mp3 extension in the end. Can I add .mp3 to this URL or what should I do for playing audio from this link on iOS.
My code is
TrackPlayer.setupPlayer().then(() => {
console.log('Player set')
});
TrackPlayer.add([{
id: 'trackId1',
url: 'https://r2---sn-gwpa-w5py.googlevideo.com/videoplayback?expire=1612552132&ei=ZEMdYNnJDumPz7sPyrSLmAw&ip=49.36.246.217&id=o-AFQLS1cSUJ6_bXBjMOIiWk1NuIYTMUTVu4rmliPZmJCS&itag=251&source=youtube&requiressl=yes&mh=VD&mm=31%2C29&mn=sn-gwpa-w5py%2Csn-gwpa-qxaz&ms=au%2Crdu&mv=m&mvi=2&pl=21&initcwndbps=225000&vprv=1&mime=audio%2Fwebm&ns=nxhNYqBZK92ToigY08JRZjEF&gir=yes&clen=230633&dur=18.961&lmt=1524503096692151&mt=1612530050&fvip=2&keepalive=yes&c=WEB&n=UIc0qqVvrMQOjPVkP&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAObqQA5vFYy6rJ3O3J4zswofNj2NFZOrwMF05p_PgWg9AiAmnde3njBRfvPmW_2VVA0YO1aLWQl0V3STGayuqgBRKA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgFTqy7Ng9zxhQY4GM4vP1BooPeHOf50PTikb59C67voACIGDybTTJBdLkp9lUx_-ZLdCulG_y3TH6iMhBbAn1AZR_&ratebypass=yes',
title: 'Title',
artist: 'Artist',
artwork: 'https://lh3.googleusercontent.com/jpatCs-PW2LbLWMITjnM9wh5W49QL1c5dhMD3_v6LDZ1okUGgJZIyqp5z4F_Pred10sZlFYjB3Vk6pRE=w1920-h1080-l90-rj'
}]);
TrackPlayer.play();
Thanks in advance
Yes, your url should look something like this
https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3
, but this means that the track you want to play has to be uploaded somewhere as a mp3 file