FPFlowplayer tvOS SDK exposes the same functionality and behaves as its counterpart on iOS SDK FPFlowplayerViewController. The only difference is that FPFlowplayer is not a UIViewController and does not handle any UI.
All available properties of FPFlowplayer are included in the following table.
| Property | Type | Description |
|---|---|---|
autoStart | Bool | Flag that indicates if media playback should auto start when the player is ready to play. |
playbackStarted | Bool | Flag that indicates if media playback has started. |
isShowingAds | Bool | Flag that indicates if the player is displaying Ads at the current moment. |
currentSubtitleTrack | FPSubtitleTrack? | Currently selected subtitle track for the media playback. |
subtitleTracks | [FPSubtitleTrack] | All available FPSubtitleTracks of the current FPMedia. |
currentAudioTrack | FPAudioTrack? | Currently selected audio track for the media playback. |
audioTracks | [FPAudioTrack] | All available FPAudioTracks of the current FPMedia. |
controller | UIViewController | UIViewController where the instance AVPlayer is attached. |
player | AVPlayer | Current AVPlayer instance that is handled by FPFlowplayer. |
delegate | FPFlowplayerDelegate? | The object that acts as the delegate of the FPFlowplayer object. |
media | FPMedia? | Current media item loaded into the player. |
duration | Int64 | Total duration of the current media item. |
currentPosition | Int64 | Current position of media playback. |
currentSpeed | Float | Current playback speed of media playback. |
All available methods of FPFlowplayer are listed in this section.
@discardableResult
func reload() -> BoolReload the current media playback. This action will destroy the current session and refetch and load every asset again.
Boolean indicating if media was reloaded.
func pause()Pause the current media playback.
func play()Start or resume the current media playback. If the playback has completed, then seek back to the beginning and start again.
func stop()Stop the current media playback. The current media session will be terminated and cleared.
func mute(_ state: Bool)Mute the current media playback.
state: If true, will mute the current sound of the media playback.
func setVolume(_ volume: Float)Set the volume of the current media playback.
Parameters
volume: Sound volume represented from 0.0 to 1.0.
func seek(_ position: Int64)Seek to the desired position of the current media playback.
position: Position of media playback.
func setSpeed(_ speed: Float)Set the playback rate/speed ot the current media playback.
speed: Speed of media playback.
func setAudioTrack(_ id: Int)Sets a new audio track for the media.
id: The id of the track to select.
func setSubtitleTrack(_ id: Int)Sets a new subtitle track for the media.
id: The id of the track to select.