Listening to player events

To list to playback and player related events, you have to make your view controller to implement the FPFlowplayerDelegate protocol, then add the delegates to the FPFlowplayerViewController.

Copy
Copied
class PlayerViewController: UIViewController, FPFlowplayerDelegate {

    let flowplayerViewController = FPFlowplayerViewController()

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)

        ...

        flowplayerViewController.addPlayerDelegate(self)
    }
}

FPFlowplayerDelegate events

All the available callback and events that FPFlowplayerDelegate supports are as follows.

Copy
Copied
/**
Callback for FPIdleEvent.
- Parameter event: The payload of the event.
*/
func onIdle(event: FPIdleEvent)

/**
Callback for FPReadyEvent
- Parameters:
	- event: The playload of the event
*/
func onReady(event: FPReadyEvent)

/**
Callback for FPPlayEvent.
- Parameter event: The payload of the event.
*/
func onPlay(event: FPPlayEvent)

/**
Callback for FPPauseEvent.
- Parameter event: The payload of the event.
*/
func onPause(event: FPPauseEvent)

/**
Callback for FPBufferEvent.
- Parameter event: The payload of the event.
*/
func onBuffer(event: FPBufferEvent)

/**
Callback for FPCompleteEvent.
- Parameter event: The payload of the event.
*/
func onComplete(event: FPCompleteEvent)

/**
Callback for FPFullscreenEvent.
- Parameter event: The payload of the event.
*/
func onFullscreen(event: FPFullscreenEvent)

/**
Callback for FPMuteEvent.
- Parameter event: The payload of the event.
*/
func onMute(event: FPMuteEvent)

/**
Callback for FPVolumeEvent.
- Parameter event: The payload of the event.
*/
func onVolume(event: FPVolumeEvent)

/**
Callback for FPSpeedEvent.
- Parameter event: The payload of the event.
*/
func onSpeed(event: FPSpeedEvent)

/**
Callback for FPAudioTracksEvent.
- Parameter event: The payload of the event.
*/
func onAudioTracks(event: FPAudioTracksEvent)

/**
Callback for FPOvpMetadataEvent.
- Parameter event: The palyload of the event.
*/
func onOvpMetadata(event: FPOvpMetadataEvent)

/**
Callback for FPAudioTrackSelectEvent.
- Parameter event: The payload of the event.
*/
func onAudioTrackSelect(event: FPAudioTrackSelectEvent)

/**
Callback for FPSubtitleTrackSelectEvent.
- Parameter event: The payload of the event
*/
func onSubtitleTrackSelect(event: FPSubtitleTrackSelectEvent)

/**
Callback for FPSubtitleTracksEvent
- Parameter event: The payload of the event
*/
func onSubtitleTracks(event: FPSubtitleTracksEvent)

/**
Callback for FPErrorEvent.
- Parameter event: The payload of the event.
*/
func onError(event: FPErrorEvent)

/**
Callback for FPAdBreakStartEvent.
- Parameter event: The payload of the event.
*/
func onAdBreakStart(event: FPAdBreakStartEvent)

/**
Callback for FPAdBreakCompleteEvent.
- Parameter event: The payload of the event.
*/
func onAdBreakComplete(event: FPAdBreakCompleteEvent)

/**
Callback for FPAdStartEvent.
- Parameter event: The payload of the event.
*/
func onAdStart(event: FPAdStartEvent)

/**
Callback for FPAdPauseEvent.
- Parameter event: The payload of the event.
*/
func onAdPause(event: FPAdPauseEvent)

/**
Callback for FPAdResumeEvent.
- Parameter event: The payload of the event.
*/
func onAdResume(event: FPAdResumeEvent)

/**
Callback for FPAdClickEvent.
- Parameter event: The payload of the event.
*/
func onAdClick(event: FPAdClickEvent)

/**
Callback for FPAdSkipEvent.
- Parameter event: The payload of the event.
*/
func onAdSkip(event: FPAdSkipEvent)

/**
Callback for FPAdCompleteEvent.
- Parameter event: The payload of the event.
*/
func onAdComplete(event: FPAdCompleteEvent)

/**
Callback for FPAdErrorEvent.
- Parameter event: The payload of the event.
*/
func onAdError(event: FPAdErrorEvent)

/**
Callback for FPCastingEvent.
- Parameter event: The payload of the event.
*/
func onCasting(event: FPCastingEvent)