You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This is more a question then a bug, but I have noticed that when a track is loaded, there is a duplicate request made to the url provided. I don't really think this is a bug within SwiftAudioEx as much as its just the way things work within the AVAudio system because this issue is not unique to SwiftAudioEx but also exists in a number of other libraries that I have tried, that use the same iOS libraries such as AVUrlAsset and AVPlayer, but I am hoping to receive some guidance on if this issue is avoidable in any way.
To Reproduce
Just load a track into QueuedAudioPlayer. You will notice in any network logger that two requests are made to the url as shown in the screenshot.
Expected behavior
That only one request will occur for the given url.
Screenshots
Additional context
The first of the requests seems to come from the AVURLAsset method, which you would expect, but then it seems to be hit again when the replaceCurrentItem method is fired. As mentioned, I am not sure that there is really a way to prevent this as this seems to be the correct way to load a remote object into the AVPlayer, as I have noticed the same order of operations on a number of other iOS libraries that load a remote object into the AVPlayer and I do indeed see the duplicate requests there as well. It does not cause any direct issues, it is only a problem for one of our clients that uses the request to capture analytics for how many times the endpoint is being hit, and this can potentially lead to double the actual number. And we may just have to fix it on the backend to ignore these "duplicate" requests, but I just wanted to check here to see if there was anything that we could do within the app/this library to prevent these duplicate requests?
The text was updated successfully, but these errors were encountered:
Describe the bug
This is more a question then a bug, but I have noticed that when a track is loaded, there is a duplicate request made to the url provided. I don't really think this is a bug within SwiftAudioEx as much as its just the way things work within the AVAudio system because this issue is not unique to SwiftAudioEx but also exists in a number of other libraries that I have tried, that use the same iOS libraries such as AVUrlAsset and AVPlayer, but I am hoping to receive some guidance on if this issue is avoidable in any way.
To Reproduce
Just load a track into QueuedAudioPlayer. You will notice in any network logger that two requests are made to the url as shown in the screenshot.
Expected behavior
That only one request will occur for the given url.
Screenshots
Additional context
The first of the requests seems to come from the AVURLAsset method, which you would expect, but then it seems to be hit again when the replaceCurrentItem method is fired. As mentioned, I am not sure that there is really a way to prevent this as this seems to be the correct way to load a remote object into the AVPlayer, as I have noticed the same order of operations on a number of other iOS libraries that load a remote object into the AVPlayer and I do indeed see the duplicate requests there as well. It does not cause any direct issues, it is only a problem for one of our clients that uses the request to capture analytics for how many times the endpoint is being hit, and this can potentially lead to double the actual number. And we may just have to fix it on the backend to ignore these "duplicate" requests, but I just wanted to check here to see if there was anything that we could do within the app/this library to prevent these duplicate requests?
The text was updated successfully, but these errors were encountered: