PlayerFactory
@available(iOS 14.0, tvOS 14.0, *)
public class PlayerFactory
Factory to create a Player
instance.
-
Returns the player SDK version number.
Declaration
Swift
public static var sdkVersion: String { get }
-
Creates a player instance configured via the provided
PlayerConfig
.Declaration
Swift
@available(*, deprecated, renamed: "createPlayer(playerConfig:﹚", message: "Use createPlayer(playerConfig:﹚ instead. In case of standalone Player Core usage, update to PlayerCoreFactory.createPlayer(playerConfig:﹚") public static func create(playerConfig: PlayerConfig = PlayerConfig()) -> Player
Parameters
playerConfig
player configuration
Return Value
Player instance
-
Declaration
Swift
public static func _registerModuleFactories<T>(_ factory: @escaping (Player) -> T) where T : _PlayerModule
-
Returns the analytics collector SDK version number.
Only accessible from Swift as the analytics collector does not have ObjC support for this property.
Declaration
Swift
static var analyticsSdkVersion: String { get }
-
Creates a
Player
instance where Analytics is enabled and configured via the providedPlayerConfig
and theBitmovinAnalyticsConfig
.Declaration
Swift
@available(*, deprecated, renamed: "createPlayer(playerConfig:analytics:﹚") static func create( // swiftlint:disable:this function_default_parameter_at_end playerConfig: PlayerConfig = PlayerConfig(), analyticsConfig: AnalyticsConfig, defaultMetadata: DefaultMetadata = DefaultMetadata() ) -> Player
Parameters
playerConfig
Player configuration
analyticsConfig
Analytics configuration
defaultMetadata
The
DefaultMetadata
which acts as fallback if not specified elsewhere.Return Value
Player
instance -
Creates and configures a
Player
instance.The
AnalyticsPlayerConfig
can be used to customize the analytics data collection, or to disable analytics support for thePlayer
instance.Note
If you have manually configured Bitmovin Analytics using the
BitmovinAnalyticsCollector
, either migrate to the bundled collector or disable bundled analytics by passingAnalyticsPlayerConfig.disabled
toanalytics
. Using both, the bundled and the manually configured collector will result in a crash.Declaration
Swift
static func createPlayer( playerConfig: PlayerConfig = PlayerConfig(), analytics: AnalyticsPlayerConfig = .enabled ) -> Player
Parameters
playerConfig
Player configuration
analytics
Analytics player config to customize analytics data collection, or to disable analytics support
Return Value
Player
instance