FRadioPlayerDelegate

@objc public protocol FRadioPlayerDelegate: class

The FRadioPlayerDelegate protocol defines methods you can implement to respond to playback events associated with an FRadioPlayer object.

  • Called when player changes state

    Declaration

    Swift

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

    Parameters

    player

    FRadioPlayer

    state

    FRadioPlayerState

  • Called when the player changes the playing state

    Declaration

    Swift

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

    Parameters

    player

    FRadioPlayer

    state

    FRadioPlaybackState

  • Called when player changes the current player item

    Declaration

    Swift

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

    Parameters

    player

    FRadioPlayer

    url

    Radio URL

  • Called when player item changes the timed metadata value, it uses (separatedBy: -) to get the artist/song name, if you want more control over the raw metadata, consider using metadataDidChange rawValue instead

    Declaration

    Swift

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

    Parameters

    player

    FRadioPlayer

    artistName

    The artist name

    trackName

    The track name

  • Called when player item changes the timed metadata value

    Declaration

    Swift

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

    Parameters

    player

    FRadioPlayer

    rawValue

    metadata raw value

  • Called when the player gets the artwork for the playing song

    Declaration

    Swift

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

    Parameters

    player

    FRadioPlayer

    artworkURL

    URL for the artwork from iTunes