|
| 1 | +// |
| 2 | +// SLRGooglePALPlugin.swift |
| 3 | +// StreamLayerPlugins |
| 4 | +// |
| 5 | +// Created by Vadim Vitvitskii on 27.01.2025. |
| 6 | +// |
| 7 | + |
| 8 | +import Foundation |
| 9 | +import StreamLayerSDK |
| 10 | +import StreamLayerSDKGooglePAL |
| 11 | + |
| 12 | +public class SLRGooglePALPlugin: SLRGooglePALServiceProtocol { |
| 13 | + |
| 14 | + private let googlePALService: SLRGooglePALService |
| 15 | + |
| 16 | + public init() { |
| 17 | + self.googlePALService = SLRGooglePALService() |
| 18 | + } |
| 19 | + |
| 20 | + public func requestNonceManager( |
| 21 | + baseURL: URL, |
| 22 | + options: SLRGooglePALOptions, |
| 23 | + completion: @escaping ((Result<URL, any Error>) -> Void) |
| 24 | + ) { |
| 25 | + let internalOptions = options.internalOptions |
| 26 | + googlePALService.requestNonceManager(baseURL: baseURL, options: internalOptions, completion: completion) |
| 27 | + } |
| 28 | + |
| 29 | + public func sendPlaybackStart() { |
| 30 | + googlePALService.sendPlaybackStart() |
| 31 | + } |
| 32 | + |
| 33 | + public func sendPlaybackEnd() { |
| 34 | + googlePALService.sendPlaybackEnd() |
| 35 | + } |
| 36 | + |
| 37 | + public func sendAdClick() { |
| 38 | + googlePALService.sendAdClick() |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +extension SLRGooglePALOptions { |
| 43 | + var internalOptions: SLRGooglePALPluginOptions { |
| 44 | + SLRGooglePALPluginOptions( |
| 45 | + env: env, |
| 46 | + hasEnv: hasEnv, |
| 47 | + gdfpReq: gdfpReq, |
| 48 | + hasGdfpReq: hasGdfpReq, |
| 49 | + iu: iu, |
| 50 | + hasIu: hasIu, |
| 51 | + output: output, |
| 52 | + hasOutput: hasOutput, |
| 53 | + sz: sz, |
| 54 | + hasSz: hasSz, |
| 55 | + unviewedPositionStart: unviewedPositionStart, |
| 56 | + hasUnviewedPositionStart: hasUnviewedPositionStart, |
| 57 | + ciuSzs: ciuSzs, |
| 58 | + url: url, |
| 59 | + hasURL: hasURL, |
| 60 | + descriptionURL: descriptionURL, |
| 61 | + hasDescriptionURL: hasDescriptionURL, |
| 62 | + correlator: correlator, |
| 63 | + hasCorrelator: hasCorrelator, |
| 64 | + custParams: custParams, |
| 65 | + plcmt: plcmt, |
| 66 | + hasPlcmt: hasPlcmt, |
| 67 | + vpa: vpa, |
| 68 | + hasVpa: hasVpa, |
| 69 | + vpmute: vpmute, |
| 70 | + hasVpmute: hasVpmute, |
| 71 | + wta: wta, |
| 72 | + hasWta: hasWta, |
| 73 | + aconp: aconp, |
| 74 | + hasAconp: hasAconp, |
| 75 | + adRule: adRule, |
| 76 | + hasAdRule: hasAdRule, |
| 77 | + adType: adType, |
| 78 | + hasAdType: hasAdType, |
| 79 | + hl: hl, |
| 80 | + hasHl: hasHl, |
| 81 | + dth: dth, |
| 82 | + hasDth: hasDth, |
| 83 | + gdpr: gdpr, |
| 84 | + hasGdpr: hasGdpr, |
| 85 | + gdprConsent: gdprConsent, |
| 86 | + hasGdprConsent: hasGdprConsent, |
| 87 | + iabexcl: iabexcl, |
| 88 | + hasIabexcl: hasIabexcl, |
| 89 | + lip: lip, |
| 90 | + hasLip: hasLip, |
| 91 | + ltd: ltd, |
| 92 | + hasLtd: hasLtd, |
| 93 | + nofb: nofb, |
| 94 | + hasNofb: hasNofb, |
| 95 | + npa: npa, |
| 96 | + hasNpa: hasNpa, |
| 97 | + omidP: omidP, |
| 98 | + hasOmidP: hasOmidP, |
| 99 | + ppt: ppt, |
| 100 | + hasPpt: hasPpt, |
| 101 | + ppos: ppos, |
| 102 | + hasPpos: hasPpos, |
| 103 | + ppid: ppid, |
| 104 | + hasPpid: hasPpid, |
| 105 | + scor: scor, |
| 106 | + hasScor: hasScor, |
| 107 | + sdkApis: sdkApis, |
| 108 | + hasSdkApis: hasSdkApis, |
| 109 | + ssss: ssss, |
| 110 | + hasSsss: hasSsss, |
| 111 | + sdmax: sdmax, |
| 112 | + hasSdmax: hasSdmax, |
| 113 | + sid: sid, |
| 114 | + hasSid: hasSid, |
| 115 | + rdp: rdp, |
| 116 | + hasRdp: hasRdp, |
| 117 | + addtlConsent: addtlConsent, |
| 118 | + hasAddtlConsent: hasAddtlConsent, |
| 119 | + afvsz: afvsz, |
| 120 | + hasAfvsz: hasAfvsz, |
| 121 | + allcues: allcues, |
| 122 | + hasAllcues: hasAllcues, |
| 123 | + cmsid: cmsid, |
| 124 | + hasCmsid: hasCmsid, |
| 125 | + vid: vid, |
| 126 | + hasVid: hasVid, |
| 127 | + exclCat: exclCat, |
| 128 | + hasExclCat: hasExclCat, |
| 129 | + ipd: ipd, |
| 130 | + hasIpd: hasIpd, |
| 131 | + ipe: ipe, |
| 132 | + hasIpe: hasIpe, |
| 133 | + maxAdDuration: maxAdDuration, |
| 134 | + hasMaxAdDuration: hasMaxAdDuration, |
| 135 | + minAdDuration: minAdDuration, |
| 136 | + hasMinAdDuration: hasMinAdDuration, |
| 137 | + mridx: mridx, |
| 138 | + hasMridx: hasMridx, |
| 139 | + msid: msid, |
| 140 | + hasMsid: hasMsid, |
| 141 | + an: an, |
| 142 | + hasAn: hasAn, |
| 143 | + pmad: pmad, |
| 144 | + hasPmad: hasPmad, |
| 145 | + pmnd: pmnd, |
| 146 | + hasPmnd: hasPmnd, |
| 147 | + pmxd: pmxd, |
| 148 | + hasPmxd: hasPmxd, |
| 149 | + pod: pod, |
| 150 | + hasPod: hasPod, |
| 151 | + pp: pp, |
| 152 | + hasPp: hasPp, |
| 153 | + ppsj: ppsj, |
| 154 | + hasPpsj: hasPpsj, |
| 155 | + ptpl: ptpl, |
| 156 | + hasPtpl: hasPtpl, |
| 157 | + ptpln: ptpln, |
| 158 | + hasPtpln: hasPtpln, |
| 159 | + pubf: pubf, |
| 160 | + hasPubf: hasPubf, |
| 161 | + pvtf: pvtf, |
| 162 | + hasPvtf: hasPvtf, |
| 163 | + pvid: pvid, |
| 164 | + hasPvid: hasPvid, |
| 165 | + pvidS: pvidS, |
| 166 | + hasPvidS: hasPvidS, |
| 167 | + rdid: rdid, |
| 168 | + hasRdid: hasRdid, |
| 169 | + idtype: idtype, |
| 170 | + hasIdtype: hasIdtype, |
| 171 | + isLat: isLat, |
| 172 | + hasIsLat: hasIsLat, |
| 173 | + tfcd: tfcd, |
| 174 | + hasTfcd: hasTfcd, |
| 175 | + trt: trt, |
| 176 | + hasTrt: hasTrt, |
| 177 | + vadType: vadType, |
| 178 | + hasVadType: hasVadType, |
| 179 | + vidD: vidD, |
| 180 | + hasVidD: hasVidD, |
| 181 | + vconp: vconp, |
| 182 | + hasVconp: hasVconp, |
| 183 | + vpi: vpi, |
| 184 | + hasVpi: hasVpi, |
| 185 | + vpos: vpos, |
| 186 | + hasVpos: hasVpos, |
| 187 | + impl: impl, |
| 188 | + hasImpl: hasImpl, |
| 189 | + vadFormat: vadFormat, |
| 190 | + hasVadFormat: hasVadFormat |
| 191 | + ) |
| 192 | + } |
| 193 | +} |
0 commit comments