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.



  • [x] Support internet radio URL playback
  • [x] Update and parse track metadata
  • [x] Update and show album artwork (via iTunes API)
  • [x] Automatic handling of interruptions
  • [x] Automatic handling of route changes
  • [x] Support bluetooth playback
  • [x] Swift 4
  • [x] Full documentation
  • [ ] Handling network errors
  • [ ] Support for Carthage
  • [ ] Support for Audio Taps
  • [ ] Support for Audio Recording


  • iOS 9 +
  • Xcode 9
  • Swift 4



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

pod 'FRadioPlayer'


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 swift player.radioURL = URL(string: "")


  • 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?)


Fethi El Hassasna


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