From 77323bdac91ee9f3fb0bf6b82d5b23b6cfe003cd Mon Sep 17 00:00:00 2001 From: Sergey Chausov Date: Thu, 20 Oct 2022 13:34:39 +0300 Subject: [PATCH] FEC-9936 Missing IMA DAI parameters added to config (#63) FEC-9936 Missing IMA DAI parameters added to config --- Sources/IMADAIConfig.swift | 3 +++ Sources/IMADAIPlugin.swift | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Sources/IMADAIConfig.swift b/Sources/IMADAIConfig.swift index 69cdaf0..eb20a6e 100644 --- a/Sources/IMADAIConfig.swift +++ b/Sources/IMADAIConfig.swift @@ -36,6 +36,9 @@ import GoogleInteractiveMediaAds } @objc public var videoId: String? // Needed for VOD @objc public var licenseUrl: String? + @objc public var adTagParams: [String: String]? + @objc public var streamActivityMonitorId: String? + @objc public var authToken: String? // IMASettings @objc public var ppid: String? diff --git a/Sources/IMADAIPlugin.swift b/Sources/IMADAIPlugin.swift index 31f1e1c..bbc1afb 100644 --- a/Sources/IMADAIPlugin.swift +++ b/Sources/IMADAIPlugin.swift @@ -228,6 +228,18 @@ import PlayKitUtils request.apiKey = pluginConfig.apiKey + if let adTagParameters = pluginConfig.adTagParams { + request.adTagParameters.merge(adTagParameters) { _, new in new } + } + + if let monitorID = pluginConfig.streamActivityMonitorId { + request.streamActivityMonitorID = monitorID + } + + if let authToken = pluginConfig.authToken { + request.authToken = authToken + } + if IMADAIPlugin.adsLoader == nil || stateMachine.getState() == .adsRequestFailed || stateMachine.getState() == .adsRequestTimedOut { createAdsLoader() }