Hi All, I am adding the song one by one, the song is being played from a url, but the problem is that after a call play(), the song takes between 3 to 20 seconds on even more sometimes. Can someone help me solve this problem pls ?
Which platform?
@guichaguri IOS
I'm using version 1.0.0
I think it has to do with the buffer. I want to make the song play once it gets the first bit buffered.
@Guichaguri any suggestions ?
@Guichaguri it is working well on the simulator, but when I test on a real device it does not work as expected, sometimes I have to wait forever.
@dcvz any suggestions about this issue ?
Experimenting the same with a little delay at the beginning of the reading.
@ntk860 @ishigamii I haven't seen this on iOS or Android and I'm using 1.0.0 and loading pretty large mp3s over the network. Maybe mess around with the track-player.json settings
Mine look like:
{
"exoplayer": true,
"cache": true,
"hls": true,
"smoothstreaming": true
}
@CapitanRedBeard let me try this. Also it varies from device to device. On iPhone 5 the delay is less than on iPhone X
@CapitanRedBeard unfortunately its not working, I am still experiencing the delay on iPhone 6 and X
The track-player.json config is only used in Android, and only defines which addons will be bundled with the app.
@dcvz any updates ?
Is this issue still appearing in the release from today? (1.1.0)
On 20. Jan 2019, at 01:30, Evanilson Braulio notifications@github.com wrote:
@dcvz any updates ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
I am using the #dev version, let change to 1.1.0 and see what happens. Thank you!
@dcvz it worse, but this time its happening on the simulator and device. The status says that its playing but it takes a long time to calculate the duration and play the audio.
@dcvz I'm having the same issue. Changing the buffer settings doesn't help. It looks like the entire file is loaded before being played.
@dcvz By the way, it looks like getBufferedPosition() always returns 0.
I think there is an improvement on this issue for version 1.1.1, after I call play the song starts buffering, and plays when its finish buffering. The problem now is that its taking so much time buffering, my guess is that its waiting until the all song gets buffered and them play it.
Looking into this now, will keep ya'll posted
Could someone who is getting this issue please try this commit? 73cf52bd2135d2c7ff472c97a4ab92809b6c47a8
@dcvz I think its working now, some songs that I am playing are still taking a considerable amount of time buffering, and I think it has to do with kbps of the songs I am playing. What do you think is the best format to use ? WAV, MP3 or OGG ?
@dcvz @ntk860 No, it's still not working. getBufferedPosition() always returns 0. Also, changing the setupOptions (minBuffer, playBuffer,...) doesn't have any impact.
@ataravati minBuffer, platBuffer is only for android. getBufferedPosition() is returning 0 after the song starts playing ?
@ntk860 It doesn't say that in the documentation. Are you sure you're not confusing with the build preferences (https://github.com/react-native-kit/react-native-track-player/wiki/Build-Preferences)?
Yes, it returns 0 before and after the song starts playing.
@ataravati I am sorry, in my use case I don't need to use getBufferredPosition(). When I said its working I was saying that the delay disappeared and the buffering is considerable short.
@dcvz I tried playing a wav file and the buffering is much less compared to a mp3. Thank God I am still beta testing, and that was the issue that was holding me back to release to production.
@dcvz any updates on this?
I'm also experiencing this issue on iOS, and using 1.1.3.
I've tried many things, but ultimately, it appears there are a few issues here. Firstly, when a track is added to the queue, it begins to buffer immediately, even without attempting to play. Secondly, It looks like it waits for the entire file to be buffered/downloaded before it is able to play. I've added a download for offline feature in my app, and the download time is the same as Track Player's buffer time.
Thirdly, this becomes a problem when in a queue, because if one track is buffering, skipping to another has to wait until the previous one finished buffering, before it then adds and buffers the next one. Put two large tracks next to each other and skip between them and player state can get stuck in the loading state. There is also no caching, so skipping back and forth will repeat this process too.
Right now it would appear, for iOS at least, it looks like it'd be best to just download the track, then use the downloaded file rather than a remote one, and do a clean up of the files on reset or something. At least that way, skipping between tracks in a queue will already have them ready to play without buffering/loading the tracks that are in the queue each time.
Hopefully that info can help with being able to resolve the issues, I'm happy to test anything.
thanks for the detailed report @markgoodyear :) this should help pin down what's going on
@dcvz : I am facing the same issue with version 1.1.4 which @markgoodyear mention. Is there any solution out there.
Any update on this issue
V 1.1.8 still the same. the delay got worse.
@dcvz If you give me an idea where to look I might be able to help fix this issue. This is hindering our iOS experience! ( you can try this on our app maktub.app )
Any updates on this? Player is taking too long to play tracks.Same goes when skip to next and previous song. This is a major blocker for iOS app.
@deepaksingh16 : Have you tried latest version 1.2.3. I think i had updated to latest version and doesn't seems to be issue there.
@jariwalabhavesh I'am using v1.2.3 and the issue still persists. Let me know if you've made any changes while setting up player.
@dcvz Can you please look into this issue as this is still happening in v1.2.3?
@deepaksingh16 do you experience the issue in the example app? If so, are you able to share some URLs to test with?
@curiousdustin I was able to play song in app. Thank you for directing me to demo app.
However I would like to share the reason for this issue.
The issue arises when i try to use code as follows:
await TrackPlayer.skipToPrevious().then(() => {
// Code after skipping
})
However without using _then_ , it works completely fine. Like code below
await TrackPlayer.skipToPrevious()
// Code after skipping
Hope it helps anyone having same problem and there could be something that we can fix for next versions.
In you first example, you don't need to use await if you are using .then(). Does it also resolve your issue if you remove await?
@curiousdustin No that didn't solve the problem. Actually it was without await in my code for first example. I mistakenly put it here.
But the solution was not to use then in this case.
Would you be able to share a more detailed example of what code you were trying to run within .then()?
It _should_ be able to be used this way.
I was just logging analytics event inside .then()
e.g.
TrackPlayer.skipToPrevious().then(async () => {
await analytics().logEvent(EVENT_PREVIOUS_SONG, {})
})
I am also facing the same issue,
When I click on the play button then it takes 10-15 seconds to update the timecode and the time code is not increasing continuously. I don't know what's wrong is happening.
Most helpful comment
Looking into this now, will keep ya'll posted