iOS Player SDK: preload and precache for instant playback
iOS Player SDK: preload and precache for instant playback
The FastPix iOS Player SDK can now preload and precache upcoming playlist items for near-instant playback, and its default endpoints have moved to fastpix.com.
What’s new:
-
Preload upcoming items: a new
PreloadManager(PreloadManager.shared) warms upcoming playlist items in the background using a shadowAVPlayer, bufferingAVPlayerIteminstances before the viewer navigates. Query state withpreloadStatus(forVideo:), hand off a warmed item withconsumePreloadedItem(for:), and cancel in-flight work withclearAll()indeinit. APreloadManagerDelegatereports start, ready, fail, cancel, and auto-advance events. -
Precache HLS segments to disk: a new
PrecacheManager(PrecacheManager.shared) downloads HLS segments to local disk and serves them on subsequent playback for lower startup latency. Start withstartPrecaching(url:), stop withstopAllPrecaching(), and track cache hits and misses viaPrecacheManagerDelegate. DRM-protected items are excluded from precaching since their segments are encrypted; preloading still applies to them. -
Automatic in playlists: preloading and precaching re-trigger on
next(),previous(),jumpTo(), andFastPixPlaylistStateChangedto keep the preload window ahead of the current position. Works with token-protected streams, custom domains, and playlist-based playback. -
Default hosts moved to fastpix.com: the HLS playback (
stream.fastpix.com), DRM license and certificate (api.fastpix.com), and spritesheet/poster (images.fastpix.com) defaults migrated from.io. If you rely on the defaults, upgrading is enough; the.iohosts still work but are slated for deprecation. -
Stability: a code-standardization pass across the SDK and an updated iOS Data Core dependency.