FireTVPlayerViewProtocol

public protocol FireTVPlayerViewProtocol : AnyObject

Protocol describing the requirements of a fire tv player view Implement this protocol if you want to create your custom player view Set it up using the configure method of the FireTVPlayerWireframe

  • Method is called inside wireframe methods Store the presenter in a property inside your custom view That way you can notify the presenter about actions happening in the view

    Declaration

    Swift

    func setPresenter(_ presenter: FireTVPlayerPresenterProtocol)

    Parameters

    presenter

    related presenter

  • Method will be called from the presenter Use the theme to style your view

    Declaration

    Swift

    func setTheme(_ theme: FireTVPlayerThemeProtocol)

    Parameters

    theme

    theme for styling your view

  • Called from the presenter to notify you about the player name

    Declaration

    Swift

    func setPlayerName(_ playerName: String)

    Parameters

    playerName

    the name of the player

  • Method will be called from the presenter to tell the view the name of the currently playing media

    Declaration

    Swift

    func setMediaName(_ mediaName: String)

    Parameters

    mediaName

    name of the media playing

  • Notifies about the current player status

    Declaration

    Swift

    func setStatus(_ status: String)

    Parameters

    status

    the current player status

  • Tells the view about the current position text

    Declaration

    Swift

    func setPositionText(_ positionText: String)

    Parameters

    positionText

    the current position text of the player, for example 00:04:34

  • Notifies the view about the current position in milliseconds

    Declaration

    Swift

    func setPosition(_ position: Float)

    Parameters

    position

    the current position

  • Passes the maximum position (duration of the currently playing media) to the view

    Declaration

    Swift

    func setMaximumPosition(_ maximumPosition: Float)

    Parameters

    maximumPosition

    the maximum position

  • Notifies the view about the duration text of the currently playing media, for example 01:36:40

    Declaration

    Swift

    func setDurationText(_ durationText: String)

    Parameters

    durationText

    the duration text of the playing media

  • updateUI(withViewModel:) Default implementation

    Presenter calls this method to trigger an ui update without animation

    Default Implementation

    Presenter calls this method to trigger an ui update without animation

    Declaration

    Swift

    func updateUI(withViewModel viewModel: FireTVPlayerViewViewModel)

    Parameters

    viewModel

    view model for the ui update

  • Presenter calls this method to trigger an ui update with or without animation

    Declaration

    Swift

    func updateUI(withViewModel viewModel: FireTVPlayerViewViewModel, animated: Bool)

    Parameters

    viewModel

    view model for the ui update

    animated

    boolean value indicating if the ui update should animate

  • Presenter calls this method to enable or disable the user interaction of a slider representing the position of the currently playing media

    Declaration

    Swift

    func updatePositionSliderUserInteractionEnabled(_ enabled: Bool)

    Parameters

    enabled

    boolean value indicating if user interaction is enabled or not