From 35f59b7daf0d30834e525bf5ea6c9b3c154ff4f9 Mon Sep 17 00:00:00 2001 From: Nilit Danan Date: Mon, 22 Feb 2021 00:10:37 +0200 Subject: [PATCH] FEC-10688 Added a function to bypass the config fetching, in case the environment is not ready. --- Sources/OTT/KalturaOTTPlayer.swift | 22 ++++++++++++++++++++++ Sources/OVP/KalturaOVPPlayer.swift | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/Sources/OTT/KalturaOTTPlayer.swift b/Sources/OTT/KalturaOTTPlayer.swift index f40be58..4b6fdd5 100644 --- a/Sources/OTT/KalturaOTTPlayer.swift +++ b/Sources/OTT/KalturaOTTPlayer.swift @@ -187,3 +187,25 @@ import PlayKitKava } } } + +// MARK: - Bypass Config Fetching + +extension KalturaOTTPlayer { + + /** + Call this function in case the BE environment has not been set up yet with the config data. + + This function needs to be called before the `setup` function. + + * Parameters: + * partnerId: The OTT Partner ID. + * ovpPartnerId: The OVP Partner ID. + * analyticsUrl: The Analytics Url used for Kava. + * ovpServiceUrl: The OVP Service Url. + * uiConfId: The UI Conf ID. + */ + @objc public static func bypassConfigFetching(partnerId: Int64, ovpPartnerId: Int64, analyticsUrl: String, ovpServiceUrl: String, uiConfId: Int64) { + + KPOTTDMSConfigModel.shared.addPartnerConfig(partnerId: partnerId, ovpPartnerId: ovpPartnerId, analyticsUrl: analyticsUrl, ovpServiceUrl: ovpServiceUrl, uiConfId: uiConfId) + } +} diff --git a/Sources/OVP/KalturaOVPPlayer.swift b/Sources/OVP/KalturaOVPPlayer.swift index e0c0ad1..61dd016 100644 --- a/Sources/OVP/KalturaOVPPlayer.swift +++ b/Sources/OVP/KalturaOVPPlayer.swift @@ -162,3 +162,23 @@ import PlayKitProviders } } } + +// MARK: - Bypass Config Fetching + +extension KalturaOVPPlayer { + + /** + Call this function in case the BE environment has not been set up yet with the config data. + + This function needs to be called before the `setup` function. + + * Parameters: + * partnerId: The OVP Partner ID. + * analyticsUrl: The Analytics Url used for Kava. + * analyticsPersistentSessionId: Whether to set a persistent session id. + */ + @objc public static func bypassConfigFetching(partnerId: Int64, analyticsUrl: String, analyticsPersistentSessionId: Bool) { + + KPOVPConfigModel.shared.addPartnerConfig(partnerId: partnerId, analyticsUrl: analyticsUrl, analyticsPersistentSessionId: analyticsPersistentSessionId) + } +}