From dd0591b38dbef344270dfcb265b236c98ad958d8 Mon Sep 17 00:00:00 2001 From: Gal Orlanczyk Date: Sun, 12 Feb 2017 14:47:05 +0200 Subject: [PATCH 1/2] Small enhancement to player config (#82) * Small enhancement to player config (will not effect public api). * Another small fix to plugin config --- Classes/Managers/LocalAssetsManager.swift | 2 +- Classes/Player/Player.swift | 2 +- Classes/Player/PlayerConfig.swift | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Classes/Managers/LocalAssetsManager.swift b/Classes/Managers/LocalAssetsManager.swift index a6aa7e53..2745929a 100644 --- a/Classes/Managers/LocalAssetsManager.swift +++ b/Classes/Managers/LocalAssetsManager.swift @@ -156,7 +156,7 @@ public class LocalAssetsManager: NSObject { } } -@objc public protocol LocalDataStore: class { +@objc public protocol LocalDataStore { func save(key: String, value: Data) throws func load(key: String) throws -> Data func remove(key: String) throws diff --git a/Classes/Player/Player.swift b/Classes/Player/Player.swift index b53d6302..448eae1c 100644 --- a/Classes/Player/Player.swift +++ b/Classes/Player/Player.swift @@ -10,7 +10,7 @@ import UIKit import AVFoundation import AVKit -@objc public protocol PlayerDelegate: class { +@objc public protocol PlayerDelegate { func playerShouldPlayAd(_ player: Player) -> Bool func player(_ player: Player, failedWith error: String) } diff --git a/Classes/Player/PlayerConfig.swift b/Classes/Player/PlayerConfig.swift index 81b98b76..7f7bd7ff 100644 --- a/Classes/Player/PlayerConfig.swift +++ b/Classes/Player/PlayerConfig.swift @@ -39,14 +39,19 @@ public class MediaConfig: NSObject { /// A `PluginConfig` object defines config to use when loading a plugin object. public class PluginConfig: NSObject { /// Plugins config dictionary holds [plugin name : plugin config] - @objc public var config: [String : AnyObject]? + @objc public var config: [String : Any] - public init(config: [String : AnyObject]) { + override public var description: String { + return "Plugin config:\n\(self.config)" + } + + public init(config: [String : Any]) { self.config = config } - override public var description: String { - return "Plugin config:\n\(self.config)" + /// Private init. + private override init() { + fatalError("Private initializer, use `init(config:)`") } } From 42862b9e5548da79fa7d65430872d3c4f2dfdbe2 Mon Sep 17 00:00:00 2001 From: ElizaSapir Date: Sun, 12 Feb 2017 14:58:37 +0200 Subject: [PATCH 2/2] Fec 6473 (#86) * bump v0.0.9 * bump v0.1.0 * bump v0.1.1 * bump v0.1.2 and attach v on podpec * bump v0.1.3 + attach v to tag version * bump v0.1.4 * bump v0.1.6.rc2 * bump v0.1.6.rc3 * bump v0.1.6 * bump v0.1.8 * bump v0.1.9 * support wideinve privae pod * #FEC-6473 #comment update IMA SDK to v3.4.1 * comment widevine classic pod_target_xcconfig * minor fixes before relase --- Example/PlayKit/Info.plist | 2 +- Example/Podfile.lock | 16 ++++++++-------- PlayKit.podspec | 5 ++++- Plugins/IMA/IMAPlugin.swift | 29 ----------------------------- 4 files changed, 13 insertions(+), 39 deletions(-) diff --git a/Example/PlayKit/Info.plist b/Example/PlayKit/Info.plist index f66e6f0b..02954d25 100644 --- a/Example/PlayKit/Info.plist +++ b/Example/PlayKit/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.1.3 + 0.1.x-dev CFBundleSignature ???? CFBundleVersion diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 580e5d0e..474ef5e8 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,15 +1,15 @@ PODS: - GoogleAds-IMA-iOS-SDK (3.3.1) - Log (1.0) - - PlayKit (0.1.7): - - PlayKit/Core (= 0.1.7) - - PlayKit/Core (0.1.7): + - PlayKit (0.1.x-dev): + - PlayKit/Core (= 0.1.x-dev) + - PlayKit/Core (0.1.x-dev): - Log - SwiftyJSON - SwiftyXMLParser - - PlayKit/IMAPlugin (0.1.7): + - PlayKit/IMAPlugin (0.1.x-dev): - PlayKit/Core - - PlayKit/YouboraPlugin (0.1.7): + - PlayKit/YouboraPlugin (0.1.x-dev): - PlayKit/Core - Youbora-AVPlayer/dynamic - SwiftyJSON (3.1.4) @@ -31,12 +31,12 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: GoogleAds-IMA-iOS-SDK: 5643300870bd3289c47c0d0b5a2dbf595b05c336 Log: 5e368c9528db07517d18d2d04ff5fe2b6f5a1e21 - PlayKit: a7f92b59a236c9c6fbe8b36d4e862dcf76001d5a + PlayKit: ba61459980c418ece6f00656aa1e78e4e3aeac57 SwiftyJSON: c2842d878f95482ffceec5709abc3d05680c0220 SwiftyXMLParser: 8d2295fb4fbc6e2ff241e7c8d7717e159be35969 Youbora-AVPlayer: 02aea2a12a4f7e6a61d8a1747e5dfc177bf2354b Youbora-YouboraLib: 523adf7cd09c4a213e3485e6ec7c48d498986246 -PODFILE CHECKSUM: c8864665a079c30446a406ef26291ceb68c00526 +PODFILE CHECKSUM: d81c2fadcc5b7123880231eec45fd3940c2c04a8 -COCOAPODS: 1.1.1 +COCOAPODS: 1.2.0 diff --git a/PlayKit.podspec b/PlayKit.podspec index c773f169..fb08dde8 100644 --- a/PlayKit.podspec +++ b/PlayKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'PlayKit' -s.version = '0.1.7' +s.version = '0.1.x-dev' s.summary = 'PlayKit: Kaltura Mobile Player SDK - iOS' @@ -21,9 +21,11 @@ end s.subspec 'IMAPlugin' do |ssp| ssp.source_files = 'Plugins/IMA' ssp.xcconfig = { 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', + 'OTHER_LDFLAGS' => '$(inherited) -framework "GoogleInteractiveMediaAds"', 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/**', 'LIBRARY_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/**' } ssp.dependency 'PlayKit/Core' + ssp.dependency 'GoogleAds-IMA-iOS-SDK', '3.4.1' end s.subspec 'GoogleCastAddon' do |ssp| @@ -49,6 +51,7 @@ end s.subspec 'WidevineClassic' do |ssp| ssp.source_files = 'Widevine' ssp.dependency 'PlayKit/Core' + #ssp.dependency 'PlayKitWV' #ssp.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'GCC_PREPROCESSOR_DEFINITIONS'=>'WIDEVINE_ENABLED=1' } end diff --git a/Plugins/IMA/IMAPlugin.swift b/Plugins/IMA/IMAPlugin.swift index 5e32b505..83815223 100644 --- a/Plugins/IMA/IMAPlugin.swift +++ b/Plugins/IMA/IMAPlugin.swift @@ -6,7 +6,6 @@ // Copyright © 2016 Google, Inc. All rights reserved. // -#if IMA_ENABLED import GoogleInteractiveMediaAds public class IMAPlugin: NSObject, AVPictureInPictureControllerDelegate, PlayerDecoratorProvider, AdsPlugin, IMAAdsLoaderDelegate, IMAAdsManagerDelegate, IMAWebOpenerDelegate, IMAContentPlayhead { @@ -477,31 +476,3 @@ public class IMAPlugin: NSObject, AVPictureInPictureControllerDelegate, PlayerDe self.notify(event: AdEvent.AdWebOpenerDidCloseInAppBrowser(webOpener: webOpener)) } } - -#else - public class IMAPlugin: NSObject, PKPlugin { - - public required init(player: Player, pluginConfig: Any?, messageBus: MessageBus) { - - } - - public func onLoad(mediaConfig: MediaConfig) { - PKLog.trace("plugin \(type(of:self)) onLoad with media config: \(mediaConfig)") - self.mediaEntry = mediaConfig.mediaEntry - } - - public func onUpdateMedia(mediaConfig: MediaConfig) { - PKLog.trace("plugin \(type(of:self)) onUpdateMedia with media config: \(mediaConfig)") - self.mediaEntry = mediaConfig.mediaEntry - } - - public var mediaEntry: MediaEntry? - - public static var pluginName = String(describing: IMAPlugin.self) - - public func destroy() { - - } - } - -#endif