Swiftpack.co - fethica/FRadioPlayer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A simple radio player framework for iOS, macOS, tvOS.
.package(url: "https://github.com/fethica/FRadioPlayer.git", from: "0.1.22")



CI Status CI Status Version License Platform

FRadioPlayer is a wrapper around AVPlayer to handle internet radio playback.


To run the example project, clone the repo, and run pod install from the Example directory first.



  • ☑ Support internet radio URL playback
  • ☑ Update and parse track metadata
  • ☑ Update and show album artwork (via iTunes API)
  • ☑ Automatic handling of interruptions
  • ☑ Automatic handling of route changes
  • ☑ Support bluetooth playback
  • ☑ Swift 5
  • Full documentation
  • ☑ Network interruptions handling
  • ☑ Support for Carthage
  • ☑ Support for macOS
  • ☑ Support for tvOS
  • ☑ Support for Swift Package Manager SPM
  • ☐ Support for Audio Taps
  • ☐ Support for Audio Recording


  • macOS 10.12+
  • iOS 10.0+
  • tvOS 10.0+
  • Xcode 10.2+
  • Swift 5



FRadioPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FRadioPlayer'


FRadioPlayer is available through Carthage. To install it, simply add the following line to your Cartfile:

github "fethica/FRadioPlayer" ~> 0.1.10

Swift Package Manager

FRadioPlayer is available through SPM. To install it, simply add the following dependency to your Package.swift file:

.package(url: "https://github.com/fethica/FRadioPlayer.git", from: "0.1.18")


Drag the Source folder into your project.



  1. Import FRadioPlayer (if you are using Cocoapods)
import FRadioPlayer
  1. Get the singleton FRadioPlayer instance
let player = FRadioPlayer.shared
  1. Set the delegate for the player
player.delegate = self
  1. Set the radio URL
player.radioURL = URL(string: "http://example.com/station.mp3")


  • isAutoPlay: Bool The player starts playing when the radioURL property gets set. (default == true)

  • enableArtwork: Bool Enable fetching albums artwork from the iTunes API. (default == true)

  • artworkSize: Int Artwork image size. (default == 100 | 100x100).

  • rate: Float? Read only property to get the current AVPlayer rate.

  • isPlaying: Bool Read only property to check if the player is playing.

  • state: FRadioPlayerState Player current state of type FRadioPlayerState.

  • playbackState: FRadioPlaybackState Playing state of type FRadioPlaybackState.

Playback controls

  • Play
  • Pause
  • Stop
  • Toggle playing state

Delegate methods

Called when player changes state

func radioPlayer(_ player: FRadioPlayer, playerStateDidChange state: FRadioPlayerState)

Called when the playback changes state

func radioPlayer(_ player: FRadioPlayer, playbackStateDidChange state: FRadioPlaybackState)

Called when player changes the current player item

func radioPlayer(_ player: FRadioPlayer, itemDidChange url: URL?)

Called when player item changes the timed metadata value

func radioPlayer(_ player: FRadioPlayer, metadataDidChange artistName: String?, trackName: String?)

Called when player item changes the timed metadata value

func radioPlayer(_ player: FRadioPlayer, metadataDidChange rawValue: String?)

Called when the player gets the artwork for the playing song

func radioPlayer(_ player: FRadioPlayer, artworkDidChange artworkURL: URL?)

Swift Radio App

For more complete app features, check out Swift Radio App based on FRadioPlayer

Swift Radio


The Xcode project is generated automatically from project.yml using XcodeGen. It's only checked in because Carthage needs it, do not edit it manually.

$ mint run yonaskolb/xcodegen
💾  Saved project to FRadioPlayer.xcodeproj


Fethi El Hassasna


FRadioPlayer is available under the MIT license. See the LICENSE file for more info.


Stars: 217
Last commit: 2 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

✨Add HTTP header fields support
38 weeks ago
  • Change AVAsset to AVURLAsset.
  • Add httpHeaderFields property to set HTTP headers, example:
FRadioPlayer.shared.httpHeaderFields = ["user-agent": "FRadioPlayer"]

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics