FRadioPlayer

open class FRadioPlayer: NSObject

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

  • Returns the singleton FRadioPlayer instance.

    Declaration

    Swift

    open static let shared = FRadioPlayer()
  • The delegate object for the FRadioPlayer. Implement the methods declared by the FRadioPlayerDelegate object to respond to user interactions and the player output.

    Declaration

    Swift

    open weak var delegate: FRadioPlayerDelegate?
  • The player current radio URL

    Declaration

    Swift

    open var radioURL: URL?
  • The player starts playing when the radioURL property gets set. (default == true)

    Declaration

    Swift

    open var isAutoPlay = true
  • Enable fetching albums artwork from the iTunes API. (default == true)

    Declaration

    Swift

    open var enableArtwork = true
  • Artwork image size. (default == 100 | 100x100)

    Declaration

    Swift

    open var artworkSize = 100
  • Read only property to get the current AVPlayer rate.

    Declaration

    Swift

    open var rate: Float?
  • Check if the player is playing

    Declaration

    Swift

    open var isPlaying: Bool
  • Player current state of type FRadioPlayerState

    Declaration

    Swift

    open private(set) var state = FRadioPlayerState.urlNotSet
  • Playing state of type FRadioPlaybackState

    Declaration

    Swift

    open private(set) var playbackState = FRadioPlaybackState.stopped
  • Trigger the play function of the radio player

    Declaration

    Swift

    open func play()
  • Trigger the pause function of the radio player

    Declaration

    Swift

    open func pause()
  • Trigger the stop function of the radio player

    Declaration

    Swift

    open func stop()
  • Toggle isPlaying state

    Declaration

    Swift

    open func togglePlaying()