IOS Release: v2.42.1 - Bugfix Playback Errors
Hey Friends,
I've released an update to the iOS version of The Deadly. There appears to have been some trouble with playback from one of The Internet Archives CDN servers located in Canada. This fix should correct this problem, but please provide feedback and bug reports if you see it continue.
If you're nerdy and you want to know more, then keep reading:
Bug Details and Fix:
When you load a show from a URL at The Internet Archive, each track is a forwarder to a CDN, a Content Delivery Network. That network is a series of servers spread throughout the world and designed to distribute load. This serves two purposes: 1) It prevents everybody from streaming from a single server and overloading it, and 2) it prevents you from trying to stream from a server that's far away from you, which could potentially cause network latency to produce buffering or slowdowns. CDNs are great! We love them.
When The Deadly loads a show on iOS, it populates all the tracks from the playlist on load. We do this to allow for gapless playback. iOS's media player is interesting as it's VERY bare bones, and you can build up any type of player you want, but it lacks streaming, gapless playback.
I found an open source implementation that does this, but it is unable to do gapless playback if it needs to resolve a different URL from the one that is loaded at the time its internal playlist is built. To address this problem, each track, when loaded into the player, is resolved to its CDN address and the playlist actually contains the CDN URL, not the original track URL.
Sometimes, this appears to cause a problem. In the gap in time between loading the CDN url and playing it, there are times when the CDN stops resolving or errors out. I'm not sure why, but this is a documented fact. I've seen it in the logs that you've all sent me. In addition, there are times that the resolved CDN immediately fails. Again, it happens.
The fix is pretty straightforward: If we load a CDN URL and it doesn't playback, we need to go back to the original URL and request a new resolution of the track, and any others that also point to that CDN. When we do that, we'll repopulate the tracklist and start playing again, ideally remembering both the track and position that you were at when it failed. If playback of the track continues to fail, the payload sent from archive contains a field with a VERY reliable address that is outside of the CDN network. We can play that if we have to.
A Note On Testing
I was able to test this by simulating network failures. In the Developer Settings I have a button which I can press that simulates the CDN failing, and then I can watch what happens with playback. But this is not real world. I wasn't able to recreate the issue in the real world, and I'm an Android user, so despite spending over 10 hours in the car yesterday, some of that playing The Deadly, I didn't have an opportunity to test this.
Please test the app by listening to it on iOS and please let me know if you continue to see issues. Please send bugfixes and DM me when you do so I can check them out.
I appreciate you guys. Thank you for using the app, and please tell your friends and loved ones about it.