Releases: fethica/FRadioPlayer
Releases · fethica/FRadioPlayer
Simplified audio session options
Migrate delegate callbacks to an observer pattern
Highlights
- API: Switched from delegate callbacks to an observer pattern (one-to-many). Implement FRadioPlayerObserver and call
addObserver/removeObserver. - Streams: Added support for non-live (file) streams with duration/currentTime updates, seeking, and more robust state handling.
- Packaging: SPM-only. Removed CocoaPods/Carthage files and Travis CI.
- Swift version: Bumped to Swift tools 5.5 (Xcode 13+).
- Demo app: Revamped SwiftUI-only demo (iOS 15+):
- Reorganized into Views/Models/Resources; cleaner UI; uses AsyncImage for artwork.
- Generated with XcodeGen (no .xcodeproj in repo).
- CI: Added GitHub Actions
- spm.yml builds and tests the library.
- demo.yml generates (XcodeGen) and builds the demo.
Migration notes (delegate → observers)
- Before (delegate, one-to-one):
player.delegate = self - Now (observers, one-to-many):
player.addObserver(self) // conform to FRadioPlayerObserver
// optionally: player.removeObserver(self)
Observer callbacks to implement
radioPlayer(_:playerStateDidChange:)radioPlayer(_:playbackStateDidChange:)radioPlayer(_:itemDidChange:)radioPlayer(_:metadataDidChange:)radioPlayer(_:artworkDidChange:)radioPlayer(_:durationDidChange:)radioPlayer(_:playTimeDidChange:duration:)
✨Add HTTP header fields support
- Change
AVAssettoAVURLAsset. - Add
httpHeaderFieldsproperty to set HTTP headers, example:
FRadioPlayer.shared.httpHeaderFields = ["user-agent": "FRadioPlayer"]SwiftUI Example and Metadata improvements
- Add a new target with SwiftUI example for iOS and macOS 🚀
- Metadata retrieval improvements ✨
Big thanks to @urayoanm for adding this new features 🎸
Enhanced metadata validators
Improve the metadata validation by @nicolassrod ✨
Add metadata cleanup
Add a helper function to strip off trailing '[???]' characters left there by ShoutCast and Centova Streams.
Thanks to @cbarriga for this feature.
Swift 5 / Xcode 10.2
- Add Swift 5 and Xcode 10.2 support.
- Upgrade to Cocoapods 1.6.
Add tvOS support 📺
Add tvOS support by @sbrighiu 🎉
Fix Carthage
0.1.14 Update version
Add macOS support 🖥
Add macOS support by @misteral 🎉