From 7102a7c4cf9fe025cac2710e13f1a4732ea9e283 Mon Sep 17 00:00:00 2001 From: Oleksandr Kharchenko Date: Mon, 25 Nov 2024 14:03:36 +0200 Subject: [PATCH] [CORE-5162] Updated logic for retrieving analytics licence --- Sources/PlaybackSDK/PlayBackSDKManager.swift | 2 ++ .../Player Plugin/BitMovinPlugin/BitmovinPlayerPlugin.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/PlaybackSDK/PlayBackSDKManager.swift b/Sources/PlaybackSDK/PlayBackSDKManager.swift index 58af4f2..078260d 100644 --- a/Sources/PlaybackSDK/PlayBackSDKManager.swift +++ b/Sources/PlaybackSDK/PlayBackSDKManager.swift @@ -95,6 +95,7 @@ public class PlayBackSDKManager { private var cancellables = Set() // MARK: Internal properties + internal var analytics: Mux? /// Bitmovin license key. internal var bitmovinLicense: String? internal var amgAPIKey: String? @@ -199,6 +200,7 @@ public class PlayBackSDKManager { // Set the received Bitmovin license self.bitmovinLicense = playerInfo.player.bitmovin.license + self.analytics = playerInfo.player.bitmovin.integrations.mux // Call the completion handler with success completion(.success(playerInfo.player.bitmovin.license)) diff --git a/Sources/PlaybackSDK/Player Plugin/BitMovinPlugin/BitmovinPlayerPlugin.swift b/Sources/PlaybackSDK/Player Plugin/BitMovinPlugin/BitmovinPlayerPlugin.swift index dc2fd2a..94a66d0 100644 --- a/Sources/PlaybackSDK/Player Plugin/BitMovinPlugin/BitmovinPlayerPlugin.swift +++ b/Sources/PlaybackSDK/Player Plugin/BitMovinPlugin/BitmovinPlayerPlugin.swift @@ -40,7 +40,7 @@ public class BitmovinPlayerPlugin: VideoPlayerPlugin { } private func createAnalyticsConfig(analyticsViewerId: String? = nil) -> AnalyticsPlayerConfig { - guard let licenseKey = PlayBackSDKManager.shared.bitmovinLicense else { + guard let licenseKey = PlayBackSDKManager.shared.analytics?.envKey else { return .disabled } let defaultMetadata = DefaultMetadata(cdnProvider: "PlaybackSDK", customUserId: analyticsViewerId)