diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 5186d07..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -4.0 diff --git a/Example/PlayerKit.xcodeproj/project.pbxproj b/Example/PlayerKit.xcodeproj/project.pbxproj index 86040d2..2e49fec 100644 --- a/Example/PlayerKit.xcodeproj/project.pbxproj +++ b/Example/PlayerKit.xcodeproj/project.pbxproj @@ -217,12 +217,12 @@ 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = 35R365FS4Q; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = 35R365FS4Q; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -232,6 +232,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -421,7 +422,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -461,7 +462,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; }; name = Release; @@ -477,8 +478,6 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -494,8 +493,6 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -514,8 +511,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -529,8 +524,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Example/PlayerKit/AppDelegate.swift b/Example/PlayerKit/AppDelegate.swift index fa736d8..9c6c861 100644 --- a/Example/PlayerKit/AppDelegate.swift +++ b/Example/PlayerKit/AppDelegate.swift @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { self.window = UIWindow(frame: UIScreen.main.bounds) self.window?.rootViewController = PlayerViewController() self.window?.makeKeyAndVisible() diff --git a/Example/PlayerKit/Info.plist b/Example/PlayerKit/Info.plist index d62bd13..1b7edec 100644 --- a/Example/PlayerKit/Info.plist +++ b/Example/PlayerKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.0 + 2.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 67e0dc3..b60840a 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -15,7 +15,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - PlayerKit: d0d7f7d0e41e9fc8857ccf00bb23aec9356349e9 + PlayerKit: 16dbe4196fbd6cbc0e677026d13ffb5fb80276fb SwiftLint: 088cfacb75b45970017e62b7524d506776d60148 PODFILE CHECKSUM: 90f31c00641fb4d5e9453ba687a3a06a32cca83f diff --git a/Example/Tests/Info.plist b/Example/Tests/Info.plist index c48e13f..f931463 100644 --- a/Example/Tests/Info.plist +++ b/Example/Tests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.4.0 + 2.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/PlayerKit.podspec b/PlayerKit.podspec index 9f880f0..d644f34 100644 --- a/PlayerKit.podspec +++ b/PlayerKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'PlayerKit' - s.version = '1.4.0' + s.version = '2.0.0' s.summary = 'A modular video player system.' s.description = <<-DESC @@ -15,6 +15,8 @@ Pod::Spec.new do |s| s.ios.deployment_target = '8.0' s.tvos.deployment_target = '9.0' + s.swift_version = "4.2" + s.source_files = 'PlayerKit/Classes/**/*' end diff --git a/PlayerKit/Classes/RegularPlayer.swift b/PlayerKit/Classes/RegularPlayer.swift index 7d749cc..b983100 100644 --- a/PlayerKit/Classes/RegularPlayer.swift +++ b/PlayerKit/Classes/RegularPlayer.swift @@ -109,7 +109,7 @@ extension AVMediaSelectionOption: TextTrackMetadata { } public func seek(to time: TimeInterval) { - let cmTime = CMTimeMakeWithSeconds(time, Int32(NSEC_PER_SEC)) + let cmTime = CMTimeMakeWithSeconds(time, preferredTimescale: Int32(NSEC_PER_SEC)) self.player.seek(to: cmTime) @@ -181,7 +181,7 @@ extension AVMediaSelectionOption: TextTrackMetadata { private func addPlayerObservers() { self.player.addObserver(self, forKeyPath: KeyPath.Player.Rate, options: [.initial, .new], context: nil) - let interval = CMTimeMakeWithSeconds(Constants.TimeUpdateInterval, Int32(NSEC_PER_SEC)) + let interval = CMTimeMakeWithSeconds(Constants.TimeUpdateInterval, preferredTimescale: Int32(NSEC_PER_SEC)) self.playerTimeObserver = self.player.addPeriodicTimeObserver(forInterval: interval, queue: DispatchQueue.main, using: { [weak self] (cmTime) in @@ -207,7 +207,7 @@ extension AVMediaSelectionOption: TextTrackMetadata { // Player Item Observers if keyPath == KeyPath.PlayerItem.Status { - if let statusInt = change?[.newKey] as? Int, let status = AVPlayerItemStatus(rawValue: statusInt) { + if let statusInt = change?[.newKey] as? Int, let status = AVPlayerItem.Status(rawValue: statusInt) { self.playerItemStatusDidChange(status: status) } } @@ -239,7 +239,7 @@ extension AVMediaSelectionOption: TextTrackMetadata { // MARK: Observation Helpers - private func playerItemStatusDidChange(status: AVPlayerItemStatus) { + private func playerItemStatusDidChange(status: AVPlayerItem.Status) { switch status { case .unknown: diff --git a/README.md b/README.md index 5fad464..6fccd70 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ To run the example project, clone the repo, and run `pod install` from the Examp ## Minimum Requirements - iOS 8.0 / tvOS 9.0 -- Swift 3.2 +- Swift 4.2 ## Installation