FLPlayerFactory
public enum FLPlayerFactory
The factory class for module FLPlayer.
This class has methods to create types exposed by this module.
-
API to access
DownloadManagersingleton instance. -
API to create a player. It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func player(asset: AVURLAsset, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> Player -
API to create a player. It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func player(_ player: AVQueuePlayer, queueItem: MediaPlaylistItem?, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> Player -
API to create a player. It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func player(contentUrl: URL, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> Player -
API to create a promo player with default playback policy or no-policy It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func promoPlayer(asset: AVURLAsset, promos: [Promo], adPlaybackPolicy: AdPlaybackPolicy? = nil, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> AdPlayer -
API to create a promo player with default playback policy or no-policy It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func promoPlayer(contentUrl: URL, promos: [Promo], adPlaybackPolicy: AdPlaybackPolicy? = nil, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> AdPlayer -
API to create a promo player with own policy implimentation. It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func promoPlayer(asset: AVURLAsset, promos: [Promo], policyHandler: PlaybackPolicyHandler, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> AdPlayer -
API to create a promo player with own policy implimentation. It is advised to create player on main thread. The player delegate callbacks will be returned on main thread by default.
Declaration
Swift
public static func promoPlayer(contentUrl: URL, promos: [Promo], policyHandler: PlaybackPolicyHandler, thumbnailConfiguration: ContentThumbnailPreviewConfiguration? = nil) -> AdPlayer -
createQueuePlayer(with:contentAVURLAsset: mediaType: mediaId: mediaMetadata: customMetadata: artWorkUrl: ) Creates a queue player with the specified player item, URL, and media metadata.
Declaration
Swift
public static func createQueuePlayer(with playerItem: AVPlayerItem, contentAVURLAsset: AVURLAsset, mediaType: String, mediaId: String? = nil, mediaMetadata: [String : Any]? = nil, customMetadata: [String : Any]? = nil, artWorkUrl: String? = nil) -> PlayerParameters
playerItemThe AVPlayerItem to be used for playback.
urlThe URL of the content to be played.
mediaTypeThe type of Media which is requested to add. The value can be ‘HLS’ | ‘MP3’ | ‘OTHER’
mediaIdThe Media Id for the content
mediaMetadataNowPlayingMetadata associated with the content.
customMetadataAdditional metadata associated with the content.
artWorkUrlThe URL for the artwork image. When provided, the player will automatically download and display the artwork in Now Playing info.
Return Value
A Player object representing the queue player.
-
thumbnailConfiguration(endPoint:noOfColumns: noOfRows: keyFrameDuration: thumbnailHeight: thumbnailWidth: ) API to create the thumbnail configuration
Declaration
Swift
public static func thumbnailConfiguration(endPoint: String, noOfColumns: Int = 10, noOfRows: Int = 10, keyFrameDuration: Int = 6, thumbnailHeight: Int = 108, thumbnailWidth: Int = 192) -> ContentThumbnailPreviewConfiguration -
API to create PlayerRemoteCommandControllable. It provides remote action handling to the player.
Declaration
Swift
public static func createRemoteCommandHandler() -> PlayerRemoteCommandControllable -
API to create a fairplay license fetcher. It is advised to create one instance and use it for one application session.
-
API to create playback policy handler
Declaration
Swift
public static func createPolicyHandler( adPlaybackPolicy: AdPlaybackPolicy? = nil, player: Player? = nil ) -> PlaybackPolicyHandler -
API to create VOD playback ad event handler
Declaration
Swift
public static func createVODAdEventHandler( policyHandler: PlaybackPolicyHandler?, adBreaks: [AdBreak], ad: [Ad], adCuepointSyncInterval: TimeInterval = 0.3 ) -> VODAdEventHandler -
API to create LIVE playback ad event handler
Declaration
Swift
public static func createLiveAdEventHandler( adBreaks: [AdBreak], ad: [Ad] ) -> LiveAdEventHandler