From 2e3eba66d423f871ed015ccd0501a8ac37f0f928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 8 Jul 2022 11:41:21 +0200 Subject: [PATCH 01/15] Bump version number --- Demo/Demo.xcconfig | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Demo/Demo.xcconfig b/Demo/Demo.xcconfig index 0a07d918..2cd88f45 100644 --- a/Demo/Demo.xcconfig +++ b/Demo/Demo.xcconfig @@ -1,5 +1,5 @@ // Version information -MARKETING_VERSION = 7.0.2 +MARKETING_VERSION = 7.0.3 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 9.0 diff --git a/Package.swift b/Package.swift index 6862278c..67068195 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion: String = "7.0.2" + static let marketingVersion: String = "7.0.3" } let package = Package( From 9d7bc784848b372370fd281df2249c374a0f5496 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Wed, 6 Jul 2022 19:37:39 +0200 Subject: [PATCH 02/15] Fastlane: build with Xcode 14 --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 9ac69b4d..9ddb7ae2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -17,7 +17,7 @@ platform :ios do before_all do ensure_git_status_clean - xcversion(version: '~> 13') + xcversion(version: '~> 14') end desc 'Run library tests' From 6f7b94705800f18604b4d2953495f04a945f41d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 7 Jul 2022 16:42:20 +0200 Subject: [PATCH 03/15] Update minimum deployment targets --- Demo/Demo.xcconfig | 2 +- Package.swift | 2 +- docs/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Demo/Demo.xcconfig b/Demo/Demo.xcconfig index 2cd88f45..eb783c12 100644 --- a/Demo/Demo.xcconfig +++ b/Demo/Demo.xcconfig @@ -2,7 +2,7 @@ MARKETING_VERSION = 7.0.3 // Deployment targets -IPHONEOS_DEPLOYMENT_TARGET = 9.0 +IPHONEOS_DEPLOYMENT_TARGET = 12.0 TVOS_DEPLOYMENT_TARGET = 12.0 // Configuration to have a single target built for all platforms diff --git a/Package.swift b/Package.swift index 67068195..fde74134 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( name: "SRGMediaPlayer", defaultLocalization: "en", platforms: [ - .iOS(.v9), + .iOS(.v12), .tvOS(.v12) ], products: [ diff --git a/docs/README.md b/docs/README.md index 3632ef6f..f7f015ca 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,7 +16,7 @@ The SRG Media Player library provides a simple way to add universal audio / vide ## Compatibility -The library is suitable for applications running on iOS 9, tvOS 12 and above. The project is meant to be compiled with the latest Xcode version. +The library is suitable for applications running on iOS 12, tvOS 12 and above. The project is meant to be compiled with the latest Xcode version. ## Contributing From 6f29abb7e19850aabd24c7c0a0b02a070f15b093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 7 Jul 2022 17:22:22 +0200 Subject: [PATCH 04/15] Update dependencies --- .../xcshareddata/swiftpm/Package.resolved | 18 +++++++++--------- Package.resolved | 18 +++++++++--------- Package.swift | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2c837e29..65c954de 100644 --- a/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,27 +5,27 @@ "package": "libextobjc", "repositoryURL": "https://github.com/SRGSSR/libextobjc.git", "state": { - "branch": null, - "revision": "30ee5b73bdf57a826978aa146881277f22369be1", - "version": "0.6.0-srg3" + "branch": "master", + "revision": "9c9a7327410fe3f7cdb695965ced43b9a7766ee0", + "version": null } }, { "package": "MAKVONotificationCenter", "repositoryURL": "https://github.com/SRGSSR/MAKVONotificationCenter.git", "state": { - "branch": null, - "revision": "60395e0601ffd4a784856b423d4cac558366276d", - "version": "1.0.0-srg5" + "branch": "master", + "revision": "8bde3cdc872085bd31f4cfe546bdf8e6932a0806", + "version": null } }, { "package": "SRGLogger", "repositoryURL": "https://github.com/SRGSSR/srglogger-apple.git", "state": { - "branch": null, - "revision": "5840af9ccbbc23a1269ff53feb3832f56ffde1eb", - "version": "3.0.2" + "branch": "feature/ios16-tvos16-xcode14", + "revision": "36fd041b78224b77d8dd348511dbf6ed8cd88d68", + "version": null } } ] diff --git a/Package.resolved b/Package.resolved index 2c837e29..65c954de 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,27 +5,27 @@ "package": "libextobjc", "repositoryURL": "https://github.com/SRGSSR/libextobjc.git", "state": { - "branch": null, - "revision": "30ee5b73bdf57a826978aa146881277f22369be1", - "version": "0.6.0-srg3" + "branch": "master", + "revision": "9c9a7327410fe3f7cdb695965ced43b9a7766ee0", + "version": null } }, { "package": "MAKVONotificationCenter", "repositoryURL": "https://github.com/SRGSSR/MAKVONotificationCenter.git", "state": { - "branch": null, - "revision": "60395e0601ffd4a784856b423d4cac558366276d", - "version": "1.0.0-srg5" + "branch": "master", + "revision": "8bde3cdc872085bd31f4cfe546bdf8e6932a0806", + "version": null } }, { "package": "SRGLogger", "repositoryURL": "https://github.com/SRGSSR/srglogger-apple.git", "state": { - "branch": null, - "revision": "5840af9ccbbc23a1269ff53feb3832f56ffde1eb", - "version": "3.0.2" + "branch": "feature/ios16-tvos16-xcode14", + "revision": "36fd041b78224b77d8dd348511dbf6ed8cd88d68", + "version": null } } ] diff --git a/Package.swift b/Package.swift index fde74134..f5e7b232 100644 --- a/Package.swift +++ b/Package.swift @@ -20,9 +20,9 @@ let package = Package( ) ], dependencies: [ - .package(name: "libextobjc", url: "https://github.com/SRGSSR/libextobjc.git", .exact("0.6.0-srg3")), - .package(name: "MAKVONotificationCenter", url: "https://github.com/SRGSSR/MAKVONotificationCenter.git", .exact("1.0.0-srg5")), - .package(name: "SRGLogger", url: "https://github.com/SRGSSR/srglogger-apple.git", .upToNextMinor(from: "3.0.0")) + .package(name: "libextobjc", url: "https://github.com/SRGSSR/libextobjc.git", .branch("master")), + .package(name: "MAKVONotificationCenter", url: "https://github.com/SRGSSR/MAKVONotificationCenter.git", .branch("master")), + .package(name: "SRGLogger", url: "https://github.com/SRGSSR/srglogger-apple.git", .branch("feature/ios16-tvos16-xcode14")) ], targets: [ .target( From 054beee8eb6a1d03456337ef37dae4028adb89b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 7 Jul 2022 17:25:00 +0200 Subject: [PATCH 05/15] Remove pre-iOS 11 compatibility method --- .../AVPlayerItem+SRGMediaPlayer.h | 21 ------------ .../AVPlayerItem+SRGMediaPlayer.m | 33 ------------------- .../SRGMediaPlayer/SRGMediaPlayerController.m | 9 +++-- .../SRGPlaybackSettingsButton~ios.m | 1 - .../SRGPlaybackSettingsViewController~ios.m | 1 - 5 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.h delete mode 100644 Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.m diff --git a/Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.h b/Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.h deleted file mode 100644 index 6acc94c5..00000000 --- a/Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) SRG SSR. All rights reserved. -// -// License information is available from the LICENSE file. -// - -@import AVFoundation; - -NS_ASSUME_NONNULL_BEGIN - -@interface AVPlayerItem (SRGMediaPlayer) - -/** - * Same as `-selectedMediaOptionInMediaSelectionGroup:`. - */ -// TODO: Remove when iOS 11 is the minimum deployment target -- (nullable AVMediaSelectionOption *)srgmediaplayer_selectedMediaOptionInMediaSelectionGroup:(AVMediaSelectionGroup *)mediaSelectionGroup; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.m b/Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.m deleted file mode 100644 index b1d3718c..00000000 --- a/Sources/SRGMediaPlayer/AVPlayerItem+SRGMediaPlayer.m +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (c) SRG SSR. All rights reserved. -// -// License information is available from the LICENSE file. -// - -#import "AVPlayerItem+SRGMediaPlayer.h" - -@implementation AVPlayerItem (SRGMediaPlayer) - -/** - * Same as `-selectedMediaOptionInMediaSelectionGroup:`. - */ -// TODO: Remove when iOS 11 is the minimum deployment target -- (AVMediaSelectionOption *)srgmediaplayer_selectedMediaOptionInMediaSelectionGroup:(AVMediaSelectionGroup *)mediaSelectionGroup -{ -#if TARGET_OS_TV - return [self.currentMediaSelection selectedMediaOptionInMediaSelectionGroup:mediaSelectionGroup]; -#else -#if !TARGET_OS_MACCATALYST - if (@available(iOS 11, *)) { -#endif - return [self.currentMediaSelection selectedMediaOptionInMediaSelectionGroup:mediaSelectionGroup]; -#if !TARGET_OS_MACCATALYST - } - else { - return [self selectedMediaOptionInMediaSelectionGroup:mediaSelectionGroup]; - } -#endif -#endif -} - -@end diff --git a/Sources/SRGMediaPlayer/SRGMediaPlayerController.m b/Sources/SRGMediaPlayer/SRGMediaPlayerController.m index e99b031e..ae878419 100644 --- a/Sources/SRGMediaPlayer/SRGMediaPlayerController.m +++ b/Sources/SRGMediaPlayer/SRGMediaPlayerController.m @@ -8,7 +8,6 @@ #import "AVAudioSession+SRGMediaPlayer.h" #import "AVMediaSelectionGroup+SRGMediaPlayer.h" -#import "AVPlayerItem+SRGMediaPlayer.h" #import "CMTime+SRGMediaPlayer.h" #import "CMTimeRange+SRGMediaPlayer.h" #import "MAKVONotificationCenter+SRGMediaPlayer.h" @@ -1811,7 +1810,7 @@ - (AVMediaSelectionOption *)selectedOptionForPlayer:(AVPlayer *)player withMedia } AVMediaSelectionGroup *group = [asset mediaSelectionGroupForMediaCharacteristic:mediaCharacteristic]; - return group ? [playerItem srgmediaplayer_selectedMediaOptionInMediaSelectionGroup:group] : nil; + return group ? [playerItem.currentMediaSelection selectedMediaOptionInMediaSelectionGroup:group] : nil; } - (void)updateTracksForPlayer:(AVPlayer *)player @@ -1929,7 +1928,7 @@ - (void)selectMediaOptionAutomaticallyInMediaSelectionGroupWithCharacteristic:(A } else if ([characteristic isEqualToString:AVMediaCharacteristicLegible]) { AVMediaSelectionGroup *audioGroup = [asset mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicAudible]; - AVMediaSelectionOption *audioOption = audioGroup ? [playerItem srgmediaplayer_selectedMediaOptionInMediaSelectionGroup:audioGroup] : nil; + AVMediaSelectionOption *audioOption = audioGroup ? [playerItem.currentMediaSelection selectedMediaOptionInMediaSelectionGroup:audioGroup] : nil; AVMediaSelectionOption *subtitleOption = SRGMediaPlayerControllerAutomaticSubtitleDefaultOption(group.srgmediaplayer_languageOptions, audioOption); [playerItem selectMediaOption:subtitleOption inMediaSelectionGroup:group]; } @@ -1950,7 +1949,7 @@ - (AVMediaSelectionOption *)selectedMediaOptionInMediaSelectionGroupWithCharacte } AVMediaSelectionGroup *group = [asset mediaSelectionGroupForMediaCharacteristic:characteristic]; - return group ? [playerItem srgmediaplayer_selectedMediaOptionInMediaSelectionGroup:group] : nil; + return group ? [playerItem.currentMediaSelection selectedMediaOptionInMediaSelectionGroup:group] : nil; } - (BOOL)matchesAutomaticSubtitleSelection @@ -1970,7 +1969,7 @@ - (BOOL)matchesAutomaticSubtitleSelection NSArray *subtitleOptions = subtitleGroup.srgmediaplayer_languageOptions; AVMediaSelectionOption *audioOption = [self selectedMediaOptionInMediaSelectionGroupWithCharacteristic:AVMediaCharacteristicAudible]; AVMediaSelectionOption *defaultSubtitleOption = SRGMediaPlayerControllerAutomaticSubtitleDefaultOption(subtitleOptions, audioOption); - AVMediaSelectionOption *subtitleOption = [playerItem srgmediaplayer_selectedMediaOptionInMediaSelectionGroup:subtitleGroup]; + AVMediaSelectionOption *subtitleOption = [playerItem.currentMediaSelection selectedMediaOptionInMediaSelectionGroup:subtitleGroup]; if (defaultSubtitleOption) { return [defaultSubtitleOption isEqual:subtitleOption]; } diff --git a/Sources/SRGMediaPlayer/SRGPlaybackSettingsButton~ios.m b/Sources/SRGMediaPlayer/SRGPlaybackSettingsButton~ios.m index bc3c2d44..37c58484 100644 --- a/Sources/SRGMediaPlayer/SRGPlaybackSettingsButton~ios.m +++ b/Sources/SRGMediaPlayer/SRGPlaybackSettingsButton~ios.m @@ -12,7 +12,6 @@ #import "AVAudioSession+SRGMediaPlayer.h" #import "AVMediaSelectionGroup+SRGMediaPlayer.h" -#import "AVPlayerItem+SRGMediaPlayer.h" #import "MAKVONotificationCenter+SRGMediaPlayer.h" #import "NSBundle+SRGMediaPlayer.h" #import "SRGMediaPlayerNavigationController.h" diff --git a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m index 17fec889..21ad3c95 100755 --- a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m +++ b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m @@ -11,7 +11,6 @@ #import "SRGPlaybackSettingsViewController.h" #import "AVMediaSelectionGroup+SRGMediaPlayer.h" -#import "AVPlayerItem+SRGMediaPlayer.h" #import "MAKVONotificationCenter+SRGMediaPlayer.h" #import "NSBundle+SRGMediaPlayer.h" #import "SRGMediaAccessibility.h" From 6d868c7bb2475a011568b8906919fb9f9a2f5b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 7 Jul 2022 17:25:57 +0200 Subject: [PATCH 06/15] Fix warning --- .../Advanced/AdvancedPlayerViewController~ios.m | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m b/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m index d290aded..aa4eac2a 100644 --- a/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m +++ b/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m @@ -139,21 +139,9 @@ - (void)viewDidLoad selector:@selector(playbackDidFail:) name:SRGMediaPlayerPlaybackDidFailNotification object:self.mediaPlayerController]; - - NSNotificationName voiceOverNotificationName = nil; -#if !TARGET_OS_MACCATALYST - if (@available(iOS 11, *)) { -#endif - voiceOverNotificationName = UIAccessibilityVoiceOverStatusDidChangeNotification; -#if !TARGET_OS_MACCATALYST - } - else { - voiceOverNotificationName = UIAccessibilityVoiceOverStatusChanged; - } -#endif [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(accessibilityVoiceOverStatusDidChange:) - name:voiceOverNotificationName + name:UIAccessibilityVoiceOverStatusDidChangeNotification object:nil]; @weakify(self) From 6b92d92a48ea45ef75e99a6edd1e98420fee884c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 7 Jul 2022 17:32:41 +0200 Subject: [PATCH 07/15] Remove pre-iOS 12 code --- .../AdvancedPlayerViewController~ios.m | 8 +- .../MPVolumeView+SRGMediaPlayer.h | 20 ---- .../MPVolumeView+SRGMediaPlayer.m | 19 ---- .../SRGMediaPlayer/NSTimer+SRGMediaPlayer.h | 2 +- .../SRGMediaPlayer/NSTimer+SRGMediaPlayer.m | 13 +-- Sources/SRGMediaPlayer/SRGAirPlayButton~ios.m | 103 ++++-------------- .../SRGMediaPlayer/SRGMediaPlayerController.m | 6 +- .../SRGMediaPlayerTimerTarget.h | 29 ----- .../SRGMediaPlayerTimerTarget.m | 30 ----- .../SRGPlaybackSettingsViewController.h | 2 +- .../SRGPlaybackSettingsViewController~ios.m | 21 ++-- Sources/SRGMediaPlayer/SRGPlayer.h | 5 - Sources/SRGMediaPlayer/SRGPlayer.m | 12 -- Sources/SRGMediaPlayer/SRGRouteDetector.h | 2 +- Sources/SRGMediaPlayer/SRGRouteDetector~ios.m | 10 +- .../include/SRGMediaPlayerConstants.h | 9 -- .../include/SRGMediaPlayerController.h | 3 +- .../include/SRGPlaybackSettingsButton.h | 4 +- 18 files changed, 44 insertions(+), 254 deletions(-) delete mode 100644 Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.h delete mode 100644 Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.m delete mode 100644 Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.h delete mode 100644 Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.m diff --git a/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m b/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m index aa4eac2a..e828f333 100644 --- a/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m +++ b/Demo/Sources/Players/Advanced/AdvancedPlayerViewController~ios.m @@ -183,9 +183,7 @@ - (void)viewDidAppear:(BOOL)animated } } - if (@available(iOS 11, *)) { - [self setNeedsUpdateOfHomeIndicatorAutoHidden]; - } + [self setNeedsUpdateOfHomeIndicatorAutoHidden]; } - (void)viewDidDisappear:(BOOL)animated @@ -314,9 +312,7 @@ - (void)setUserInterfaceHidden:(BOOL)hidden animated:(BOOL)animated animations(); [self.view layoutIfNeeded]; } completion:^(BOOL finished) { - if (@available(iOS 11, *)) { - [self setNeedsUpdateOfHomeIndicatorAutoHidden]; - } + [self setNeedsUpdateOfHomeIndicatorAutoHidden]; }]; } else { diff --git a/Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.h b/Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.h deleted file mode 100644 index 17499d45..00000000 --- a/Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (c) SRG SSR. All rights reserved. -// -// License information is available from the LICENSE file. -// - -@import MediaPlayer; - -NS_ASSUME_NONNULL_BEGIN - -@interface MPVolumeView (SRGMediaPlayer) - -/** - * Return the AirPlay button within the volume view. - */ -@property (nonatomic, readonly) UIButton *srg_airPlayButton; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.m b/Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.m deleted file mode 100644 index 6ed3f1de..00000000 --- a/Sources/SRGMediaPlayer/MPVolumeView+SRGMediaPlayer.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (c) SRG SSR. All rights reserved. -// -// License information is available from the LICENSE file. -// - -#import "MPVolumeView+SRGMediaPlayer.h" - -@implementation MPVolumeView (SRGMediaPlayer) - -- (UIButton *)srg_airPlayButton -{ - NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { - return [evaluatedObject isKindOfClass:UIButton.class]; - }]; - return [self.subviews filteredArrayUsingPredicate:predicate].firstObject; -} - -@end diff --git a/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.h b/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.h index 027f9f2c..c732f136 100644 --- a/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.h +++ b/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @interface NSTimer (SRGMediaPlayer) /** - * Create a block-based timer (a feature only available since iOS 10), scheduled with common run loop modes. + * Create a block-based timer scheduled with common run loop modes. */ + (NSTimer *)srgmediaplayer_timerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block; diff --git a/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.m b/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.m index 7de18510..64cf5c8b 100644 --- a/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.m +++ b/Sources/SRGMediaPlayer/NSTimer+SRGMediaPlayer.m @@ -6,22 +6,11 @@ #import "NSTimer+SRGMediaPlayer.h" -#import "SRGMediaPlayerTimerTarget.h" - @implementation NSTimer (SRGMediaPlayer) + (NSTimer *)srgmediaplayer_timerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer * _Nonnull timer))block { - NSTimer *timer = nil; - - if (@available(iOS 10, tvOS 10, *)) { - timer = [self timerWithTimeInterval:interval repeats:repeats block:block]; - } - else { - // Do not use self as target, since this would lead to subtle issues when the timer is deallocated - SRGMediaPlayerTimerTarget *target = [[SRGMediaPlayerTimerTarget alloc] initWithBlock:block]; - timer = [self timerWithTimeInterval:interval target:target selector:@selector(fire:) userInfo:nil repeats:repeats]; - } + NSTimer *timer = [self timerWithTimeInterval:interval repeats:repeats block:block]; // Use the recommended 10% tolerance as default, see `tolerance` documentation timer.tolerance = interval / 10.; diff --git a/Sources/SRGMediaPlayer/SRGAirPlayButton~ios.m b/Sources/SRGMediaPlayer/SRGAirPlayButton~ios.m index 083d2c0c..9bca016f 100644 --- a/Sources/SRGMediaPlayer/SRGAirPlayButton~ios.m +++ b/Sources/SRGMediaPlayer/SRGAirPlayButton~ios.m @@ -13,7 +13,6 @@ #import "AVRoutePickerView+SRGMediaPlayer.h" #import "AVAudioSession+SRGMediaPlayer.h" #import "MAKVONotificationCenter+SRGMediaPlayer.h" -#import "MPVolumeView+SRGMediaPlayer.h" #import "NSBundle+SRGMediaPlayer.h" #import "SRGRouteDetector.h" #import "UIScreen+SRGMediaPlayer.h" @@ -24,9 +23,7 @@ @interface SRGAirPlayButton () -@property (nonatomic, weak) MPVolumeView *volumeView; -@property (nonatomic, weak) AVRoutePickerView *routePickerView API_AVAILABLE(ios(11.0)); - +@property (nonatomic, weak) AVRoutePickerView *routePickerView; @property (nonatomic, weak) UIButton *fakeInterfaceBuilderButton; @end @@ -121,18 +118,6 @@ - (void)setMediaPlayerController:(SRGMediaPlayerController *)mediaPlayerControll } } -- (UIImage *)audioImage -{ - // `AVRoutePickerView`: Image is already the one we want if not specified - if (@available(iOS 11, *)) { - return _audioImage; - } - // `MPVolumeView`: Use bundled AirPlay icon when no image is specified. - else { - return _audioImage ?: [UIImage imageNamed:@"airplay_audio" inBundle:SWIFTPM_MODULE_BUNDLE compatibleWithTraitCollection:nil]; - } -} - - (void)setAudioImage:(UIImage *)audioImage { _audioImage = audioImage; @@ -190,16 +175,7 @@ - (void)layoutSubviews { [super layoutSubviews]; - if (@available(iOS 11, *)) { - self.routePickerView.frame = self.bounds; - } - else { - // Ensure proper resizing behavior of the volume view AirPlay button. - self.volumeView.frame = self.bounds; - - UIButton *airPlayButton = self.volumeView.srg_airPlayButton; - airPlayButton.frame = self.volumeView.bounds; - } + self.routePickerView.frame = self.bounds; } - (CGSize)intrinsicContentSize @@ -207,11 +183,8 @@ - (CGSize)intrinsicContentSize if (self.fakeInterfaceBuilderButton) { return self.fakeInterfaceBuilderButton.intrinsicContentSize; } - else if (@available(iOS 11, *)) { - return self.routePickerView.intrinsicContentSize; - } else { - return self.volumeView.srg_airPlayButton.intrinsicContentSize; + return self.routePickerView.intrinsicContentSize; } } @@ -231,50 +204,26 @@ - (void)updateAppearanceForMediaPlayerController:(SRGMediaPlayerController *)med // `AVRoutePickerView` is a button with no image, with layers representing the AirPlay icon instead. If we need // to display an image the original icon layers needs to be hidden first. - if (@available(iOS 11, *)) { - if (@available(iOS 13, *)) { - self.routePickerView.prioritizesVideoDevices = (mediaType == SRGMediaPlayerMediaTypeVideo); - } - - BOOL hasImage = (image != nil); - - airPlayButton = self.routePickerView.srg_airPlayButton; - airPlayButton.imageView.contentMode = hasImage ? UIViewContentModeCenter : UIViewContentModeScaleToFill; - - self.routePickerView.activeTintColor = self.activeTintColor; - self.routePickerView.srg_isOriginalIconHidden = hasImage; - } - // For `MPVolumeView` we must use a custom image to be able to apply a tint color. The button color is automagically - // inherited from the enclosing view (this works both at runtime and when rendering in Interface Builder) - else { - airPlayButton = self.volumeView.srg_airPlayButton; - airPlayButton.showsTouchWhenHighlighted = NO; - airPlayButton.tintColor = AVAudioSession.srg_isAirPlayActive ? self.activeTintColor : self.tintColor; + if (@available(iOS 13, *)) { + self.routePickerView.prioritizesVideoDevices = (mediaType == SRGMediaPlayerMediaTypeVideo); } + BOOL hasImage = (image != nil); + + airPlayButton = self.routePickerView.srg_airPlayButton; + airPlayButton.imageView.contentMode = hasImage ? UIViewContentModeCenter : UIViewContentModeScaleToFill; + + self.routePickerView.activeTintColor = self.activeTintColor; + self.routePickerView.srg_isOriginalIconHidden = hasImage; + [airPlayButton setImage:image forState:UIControlStateNormal]; [airPlayButton setImage:image forState:UIControlStateSelected]; - BOOL (^multipleRoutesDetected)(void) = ^{ -#if !TARGET_OS_MACCATALYST - if (@available(iOS 11, *)) { -#endif - return SRGRouteDetector.sharedRouteDetector.multipleRoutesDetected; -#if !TARGET_OS_MACCATALYST - } - else { - // For `MPVolumeView` to return correct route availability information, it must be installed in a view - // hierarchy. - return self.volumeView.areWirelessRoutesAvailable; - } -#endif - }; - if (self.alwaysHidden) { self.hidden = YES; } else if (mediaPlayerController) { - if (multipleRoutesDetected()) { + if (SRGRouteDetector.sharedRouteDetector.multipleRoutesDetected) { self.hidden = NO; } else { @@ -282,7 +231,7 @@ - (void)updateAppearanceForMediaPlayerController:(SRGMediaPlayerController *)med } } else { - self.hidden = ! self.fakeInterfaceBuilderButton && ! multipleRoutesDetected(); + self.hidden = ! self.fakeInterfaceBuilderButton && ! SRGRouteDetector.sharedRouteDetector.multipleRoutesDetected; } } @@ -328,12 +277,7 @@ - (void)prepareForInterfaceBuilder [fakeInterfaceBuilderButton.trailingAnchor constraintEqualToAnchor:self.trailingAnchor] ]]; - if (@available(iOS 11, *)) { - self.routePickerView.hidden = YES; - } - else { - self.volumeView.hidden = YES; - } + self.routePickerView.hidden = YES; } #pragma mark Accessibility @@ -364,17 +308,10 @@ - (NSArray *)accessibilityElements static void commonInit(SRGAirPlayButton *self) { - if (@available(iOS 11, *)) { - AVRoutePickerView *routePickerView = [[AVRoutePickerView alloc] initWithFrame:self.bounds]; - [self addSubview:routePickerView]; - self.routePickerView = routePickerView; - } - else { - MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:self.bounds]; - volumeView.showsVolumeSlider = NO; - [self addSubview:volumeView]; - self.volumeView = volumeView; - } + AVRoutePickerView *routePickerView = [[AVRoutePickerView alloc] initWithFrame:self.bounds]; + [self addSubview:routePickerView]; + self.routePickerView = routePickerView; + self.hidden = YES; } diff --git a/Sources/SRGMediaPlayer/SRGMediaPlayerController.m b/Sources/SRGMediaPlayer/SRGMediaPlayerController.m index ae878419..5c282e7c 100644 --- a/Sources/SRGMediaPlayer/SRGMediaPlayerController.m +++ b/Sources/SRGMediaPlayer/SRGMediaPlayerController.m @@ -1093,13 +1093,13 @@ - (void)play if (self.player) { // Normal conditions. Simply forward to the player if (self.playbackState != SRGMediaPlayerPlaybackStateEnded) { - [self.player playImmediatelyIfPossibleAtRate:self.effectivePlaybackRate]; + [self.player playImmediatelyAtRate:self.effectivePlaybackRate]; } // Playback ended. Restart at the beginning else { [self.player seekToTime:kCMTimeZero toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero notify:NO completionHandler:^(BOOL finished) { if (finished) { - [self.player playImmediatelyIfPossibleAtRate:self.effectivePlaybackRate]; + [self.player playImmediatelyAtRate:self.effectivePlaybackRate]; } }]; } @@ -1577,7 +1577,7 @@ - (void)updateStallDetectionTimerForPlaybackState:(SRGMediaPlayerPlaybackState)p self.lastStallDetectionDate = nil; } else if ([NSDate.date timeIntervalSinceDate:self.lastStallDetectionDate] >= 5.) { - [self.player playImmediatelyIfPossibleAtRate:self.effectivePlaybackRate]; + [self.player playImmediatelyAtRate:self.effectivePlaybackRate]; } } }]; diff --git a/Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.h b/Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.h deleted file mode 100644 index c68f9400..00000000 --- a/Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) SRG SSR. All rights reserved. -// -// License information is available from the LICENSE file. -// - -@import Foundation; - -NS_ASSUME_NONNULL_BEGIN - -/** - * Helper class used as target for a timer. - */ -// TODO: Remove when iOS / tvOS 10 is the minimum required version -@interface SRGMediaPlayerTimerTarget : NSObject - -/** - * Create the target with the specified to be executed when `-fire:` is called. - */ -- (instancetype)initWithBlock:(nullable void (^)(NSTimer *timer))block; - -/** - * Execute the attached block on behalf of the specified timer. - */ -- (void)fire:(NSTimer *)timer; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.m b/Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.m deleted file mode 100644 index fb6197d0..00000000 --- a/Sources/SRGMediaPlayer/SRGMediaPlayerTimerTarget.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) SRG SSR. All rights reserved. -// -// License information is available from the LICENSE file. -// - -#import "SRGMediaPlayerTimerTarget.h" - -@interface SRGMediaPlayerTimerTarget () - -@property (nonatomic, copy) void (^block)(NSTimer *); - -@end - -@implementation SRGMediaPlayerTimerTarget - -- (instancetype)initWithBlock:(void (^)(NSTimer * _Nonnull))block -{ - if (self = [super init]) { - self.block = block; - } - return self; -} - -- (void)fire:(NSTimer *)timer -{ - self.block ? self.block(timer) : nil; -} - -@end diff --git a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController.h b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController.h index 3f4880ff..e7fba34f 100755 --- a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController.h +++ b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController.h @@ -51,7 +51,7 @@ API_UNAVAILABLE(tvos) /** * Create an instance displaying settings for a controller and adjusted for the provided style. */ -- (instancetype)initWithMediaPlayerController:(SRGMediaPlayerController *)mediaPlayerController userInterfaceStyle:(SRGMediaPlayerUserInterfaceStyle)userInterfaceStyle; +- (instancetype)initWithMediaPlayerController:(SRGMediaPlayerController *)mediaPlayerController userInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle; /** * The view controller delegate. diff --git a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m index 21ad3c95..9abab7dc 100755 --- a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m +++ b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m @@ -40,7 +40,7 @@ @interface SRGPlaybackSettingsViewController () @property (nonatomic) SRGMediaPlayerController *mediaPlayerController; -@property (nonatomic) SRGMediaPlayerUserInterfaceStyle userInterfaceStyle; +@property (nonatomic) UIUserInterfaceStyle userInterfaceStyle; @property (nonatomic, weak) UITableView *tableView; @@ -60,7 +60,7 @@ @implementation SRGPlaybackSettingsViewController #pragma mark Object lifecycle -- (instancetype)initWithMediaPlayerController:(SRGMediaPlayerController *)mediaPlayerController userInterfaceStyle:(SRGMediaPlayerUserInterfaceStyle)userInterfaceStyle +- (instancetype)initWithMediaPlayerController:(SRGMediaPlayerController *)mediaPlayerController userInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle { if (self = [super init]) { self.mediaPlayerController = mediaPlayerController; @@ -123,9 +123,7 @@ - (void)setMediaPlayerController:(SRGMediaPlayerController *)mediaPlayerControll - (BOOL)isDark { - // TODO: Remove SRGMediaPlayerUserInterfaceStyle once SRG Media Player is requiring iOS 12 and above, and - // use UIUserInterfaceStyle instead. - if (self.userInterfaceStyle == SRGMediaPlayerUserInterfaceStyleUnspecified) { + if (self.userInterfaceStyle == UIUserInterfaceStyleUnspecified) { if (@available(iOS 13, *)) { return self.traitCollection.userInterfaceStyle != UIUserInterfaceStyleLight; } @@ -135,7 +133,7 @@ - (BOOL)isDark } } else { - return self.userInterfaceStyle == SRGMediaPlayerUserInterfaceStyleDark; + return self.userInterfaceStyle == UIUserInterfaceStyleDark; } } @@ -182,8 +180,8 @@ - (void)viewDidLoad // The style must only be overridden when forced, otherwise no traits change will occur when dark mode is toggled // in the system settings. if (@available(iOS 13, *)) { - if (self.userInterfaceStyle != SRGMediaPlayerUserInterfaceStyleUnspecified) { - self.navigationController.overrideUserInterfaceStyle = (self.userInterfaceStyle == SRGMediaPlayerUserInterfaceStyleDark) ? UIUserInterfaceStyleDark : UIUserInterfaceStyleLight; + if (self.userInterfaceStyle != UIUserInterfaceStyleUnspecified) { + self.navigationController.overrideUserInterfaceStyle = (self.userInterfaceStyle == UIUserInterfaceStyleDark) ? UIUserInterfaceStyleDark : UIUserInterfaceStyleLight; } else { self.navigationController.overrideUserInterfaceStyle = UIUserInterfaceStyleUnspecified; @@ -203,7 +201,9 @@ - (void)viewDidLoad UINavigationBar *navigationBarAppearance = [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[self.class]]; navigationBarAppearance.barTintColor = nil; navigationBarAppearance.tintColor = nil; + navigationBarAppearance.prefersLargeTitles = NO; navigationBarAppearance.titleTextAttributes = nil; + navigationBarAppearance.largeTitleTextAttributes = nil; navigationBarAppearance.translucent = YES; navigationBarAppearance.shadowImage = nil; navigationBarAppearance.backIndicatorImage = nil; @@ -211,11 +211,6 @@ - (void)viewDidLoad [navigationBarAppearance setTitleVerticalPositionAdjustment:0.f forBarMetrics:UIBarMetricsDefault]; [navigationBarAppearance setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; - if (@available(iOS 11, *)) { - navigationBarAppearance.prefersLargeTitles = NO; - navigationBarAppearance.largeTitleTextAttributes = nil; - } - [self updateViewAppearance]; } diff --git a/Sources/SRGMediaPlayer/SRGPlayer.h b/Sources/SRGMediaPlayer/SRGPlayer.h index 342557cf..395d5675 100644 --- a/Sources/SRGMediaPlayer/SRGPlayer.h +++ b/Sources/SRGMediaPlayer/SRGPlayer.h @@ -49,11 +49,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, readonly) CMTime seekTargetTime; -/** - * Attempt to play the media immediately if possible (iOS 10 and greater), otherwise normally. - */ -- (void)playImmediatelyIfPossibleAtRate:(float)rate; - /** * Seek to a given time with the provided tolerances, calling the specified handler on completion. The delegate * methods are called iff `notify` is set to `YES`. diff --git a/Sources/SRGMediaPlayer/SRGPlayer.m b/Sources/SRGMediaPlayer/SRGPlayer.m index 70000662..49a78f61 100644 --- a/Sources/SRGMediaPlayer/SRGPlayer.m +++ b/Sources/SRGMediaPlayer/SRGPlayer.m @@ -30,18 +30,6 @@ - (instancetype)init #pragma mark Playback -// TODO: Remove when iOS / tvOS 10 is the minimum required version. -- (void)playImmediatelyIfPossibleAtRate:(float)rate -{ - if (@available(iOS 10, tvOS 10, *)) { - [self playImmediatelyAtRate:rate]; - } - else { - [self play]; - self.rate = rate; - } -} - // Might be called from a background thread, in which case the completion handler might as well - (void)seekToTime:(CMTime)time toleranceBefore:(CMTime)toleranceBefore toleranceAfter:(CMTime)toleranceAfter completionHandler:(void (^)(BOOL finished))completionHandler { diff --git a/Sources/SRGMediaPlayer/SRGRouteDetector.h b/Sources/SRGMediaPlayer/SRGRouteDetector.h index 8efdf679..fadc8c61 100644 --- a/Sources/SRGMediaPlayer/SRGRouteDetector.h +++ b/Sources/SRGMediaPlayer/SRGRouteDetector.h @@ -17,7 +17,7 @@ OBJC_EXPORT NSString * const SRGMediaPlayerWirelessRoutesAvailableDidChangeNotif * Detect route availability (e.g. Bluetooth or AirPlay). Implements `AVRouteDetector` in a way that avoids * enabling it unnecessarily. */ -API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos) +API_UNAVAILABLE(tvos) @interface SRGRouteDetector : NSObject /** diff --git a/Sources/SRGMediaPlayer/SRGRouteDetector~ios.m b/Sources/SRGMediaPlayer/SRGRouteDetector~ios.m index 3ebc74b1..73b2d9ca 100644 --- a/Sources/SRGMediaPlayer/SRGRouteDetector~ios.m +++ b/Sources/SRGMediaPlayer/SRGRouteDetector~ios.m @@ -18,15 +18,13 @@ NSString * const SRGMediaPlayerWirelessRoutesAvailableDidChangeNotification = @"SRGMediaPlayerWirelessRoutesAvailableDidChangeNotification"; -API_AVAILABLE(ios(11.0)) static SRGRouteDetector *s_routeDetector; +static SRGRouteDetector *s_routeDetector; __attribute__((constructor)) static void SRGRouteDetectorInit(void) { - if (@available(iOS 11, *)) { - dispatch_async(dispatch_get_main_queue(), ^{ - s_routeDetector = [[SRGRouteDetector alloc] init]; - }); - } + dispatch_async(dispatch_get_main_queue(), ^{ + s_routeDetector = [[SRGRouteDetector alloc] init]; + }); } @interface SRGRouteDetector () diff --git a/Sources/SRGMediaPlayer/include/SRGMediaPlayerConstants.h b/Sources/SRGMediaPlayer/include/SRGMediaPlayerConstants.h index 59029ec9..e980b684 100644 --- a/Sources/SRGMediaPlayer/include/SRGMediaPlayerConstants.h +++ b/Sources/SRGMediaPlayer/include/SRGMediaPlayerConstants.h @@ -133,15 +133,6 @@ typedef NS_ENUM(NSInteger, SRGMediaPlayerSelectionReason) { SRGMediaPlayerSelectionReasonUpdate // Selection update during playback }; -/** - * User interface styles, for compatibility with `UIUserInterfaceStyle` on iOS 11 and below. - */ -typedef NS_ENUM(NSInteger, SRGMediaPlayerUserInterfaceStyle) { - SRGMediaPlayerUserInterfaceStyleUnspecified = 0, // Automatic - SRGMediaPlayerUserInterfaceStyleLight, // Light - SRGMediaPlayerUserInterfaceStyleDark // Dark -}; - /** * @name Playback setup (provided as `userInfo` to the controller). */ diff --git a/Sources/SRGMediaPlayer/include/SRGMediaPlayerController.h b/Sources/SRGMediaPlayer/include/SRGMediaPlayerController.h index b1c3ea14..d425b445 100644 --- a/Sources/SRGMediaPlayer/include/SRGMediaPlayerController.h +++ b/Sources/SRGMediaPlayer/include/SRGMediaPlayerController.h @@ -339,8 +339,7 @@ NS_ASSUME_NONNULL_BEGIN * to this state without going through the paused state. * * For an on-demand stream, the default position is its start, for DVR streams its end. When playing a DVR - * stream and the position is contained within the first chunk, playback might start at the end of the stream - * (iOS 11 and above) or at the specified position (older iOS versions). + * stream and the position is contained within the first chunk, playback starts at the end of the stream. */ - (void)prepareToPlayURL:(NSURL *)URL atPosition:(nullable SRGPosition *)position diff --git a/Sources/SRGMediaPlayer/include/SRGPlaybackSettingsButton.h b/Sources/SRGMediaPlayer/include/SRGPlaybackSettingsButton.h index 2f9fd942..7c5ab6fe 100644 --- a/Sources/SRGMediaPlayer/include/SRGPlaybackSettingsButton.h +++ b/Sources/SRGMediaPlayer/include/SRGPlaybackSettingsButton.h @@ -66,12 +66,12 @@ API_UNAVAILABLE(tvos) @property (nonatomic, null_resettable) UIImage *image; /** - * The style to be applied to the settings popover. Default value is `SRGMediaPlayerUserInterfaceStyleUnspecified` + * The style to be applied to the settings popover. Default value is `UIUserInterfaceStyleUnspecified` * (default dark appearance prior to iOS 13, and based on dark mode settings for iOS 13 and above). * * @discussion The style will be applied the next time the popover is opened. */ -@property (nonatomic) SRGMediaPlayerUserInterfaceStyle userInterfaceStyle; +@property (nonatomic) UIUserInterfaceStyle userInterfaceStyle; /** * The button delegate. From 71421195a84942adf3bd97ef5a93eb5266b9a9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 7 Jul 2022 18:05:08 +0200 Subject: [PATCH 08/15] Modernize project with Xcode 14 --- .../xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme | 2 +- Demo/SRGMediaPlayer-demo.xcodeproj/project.pbxproj | 6 +++--- .../xcshareddata/xcschemes/SRGMediaPlayer-demo.xcscheme | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme index 74add3c4..b4375a71 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 12 Jul 2022 15:03:44 +0200 Subject: [PATCH 09/15] Forward supported orientation requests in custom container --- .../SRGMediaPlayerNavigationController~ios.m | 12 ++++++++++++ .../SRGPlaybackSettingsViewController~ios.m | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/Sources/SRGMediaPlayer/SRGMediaPlayerNavigationController~ios.m b/Sources/SRGMediaPlayer/SRGMediaPlayerNavigationController~ios.m index b8d1e97a..33668f8b 100644 --- a/Sources/SRGMediaPlayer/SRGMediaPlayerNavigationController~ios.m +++ b/Sources/SRGMediaPlayer/SRGMediaPlayerNavigationController~ios.m @@ -12,6 +12,18 @@ @implementation SRGMediaPlayerNavigationController +#pragma mark Rotation + +- (BOOL)shouldAutorotate +{ + return [self.topViewController shouldAutorotate]; +} + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return [self.topViewController supportedInterfaceOrientations]; +} + #pragma mark Status bar - (UIStatusBarStyle)preferredStatusBarStyle diff --git a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m index 9abab7dc..40e004a5 100755 --- a/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m +++ b/Sources/SRGMediaPlayer/SRGPlaybackSettingsViewController~ios.m @@ -223,6 +223,13 @@ - (void)viewDidDisappear:(BOOL)animated } } +#pragma mark Rotation + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskAll; +} + #pragma mark Status bar - (UIStatusBarStyle)preferredStatusBarStyle From 463eea0cf6fdf76bb3fc530db2d1942715254637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 14 Jul 2022 10:20:53 +0200 Subject: [PATCH 10/15] Update dependencies --- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- Package.resolved | 4 ++-- Package.swift | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved index 65c954de..b4df51ea 100644 --- a/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -23,8 +23,8 @@ "package": "SRGLogger", "repositoryURL": "https://github.com/SRGSSR/srglogger-apple.git", "state": { - "branch": "feature/ios16-tvos16-xcode14", - "revision": "36fd041b78224b77d8dd348511dbf6ed8cd88d68", + "branch": "develop", + "revision": "3b7c04bccfb6714d2ea9589e98591ed9088d128e", "version": null } } diff --git a/Package.resolved b/Package.resolved index 65c954de..b4df51ea 100644 --- a/Package.resolved +++ b/Package.resolved @@ -23,8 +23,8 @@ "package": "SRGLogger", "repositoryURL": "https://github.com/SRGSSR/srglogger-apple.git", "state": { - "branch": "feature/ios16-tvos16-xcode14", - "revision": "36fd041b78224b77d8dd348511dbf6ed8cd88d68", + "branch": "develop", + "revision": "3b7c04bccfb6714d2ea9589e98591ed9088d128e", "version": null } } diff --git a/Package.swift b/Package.swift index f5e7b232..3c92585f 100644 --- a/Package.swift +++ b/Package.swift @@ -22,7 +22,7 @@ let package = Package( dependencies: [ .package(name: "libextobjc", url: "https://github.com/SRGSSR/libextobjc.git", .branch("master")), .package(name: "MAKVONotificationCenter", url: "https://github.com/SRGSSR/MAKVONotificationCenter.git", .branch("master")), - .package(name: "SRGLogger", url: "https://github.com/SRGSSR/srglogger-apple.git", .branch("feature/ios16-tvos16-xcode14")) + .package(name: "SRGLogger", url: "https://github.com/SRGSSR/srglogger-apple.git", .branch("develop")) ], targets: [ .target( From a43e8a963b167b2e8c01e739d5e43436337003eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Mon, 18 Jul 2022 15:04:30 +0200 Subject: [PATCH 11/15] Bump version number --- Demo/Demo.xcconfig | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Demo/Demo.xcconfig b/Demo/Demo.xcconfig index eb783c12..017fc0a6 100644 --- a/Demo/Demo.xcconfig +++ b/Demo/Demo.xcconfig @@ -1,5 +1,5 @@ // Version information -MARKETING_VERSION = 7.0.3 +MARKETING_VERSION = 7.0.4 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index 3c92585f..3f6b7af3 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion: String = "7.0.3" + static let marketingVersion: String = "7.0.4" } let package = Package( From 202d166244a8a8e8dcd24f3ba19f43d479da0881 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Thu, 11 Aug 2022 16:11:20 +0200 Subject: [PATCH 12/15] Update fastlane to 2.208.0 --- Gemfile.lock | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ba734c7e..426d0bc9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,23 +8,23 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.597.0) - aws-sdk-core (3.131.1) + aws-partitions (1.616.0) + aws-sdk-core (3.132.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.57.0) + aws-sdk-kms (1.58.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.114.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.0) + aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) - claide (1.0.3) + claide (1.1.0) colored (1.2) colored2 (3.1.2) commander (4.6.0) @@ -34,10 +34,10 @@ GEM rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) + dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.92.3) - faraday (1.10.0) + excon (0.92.4) + faraday (1.10.1) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -66,7 +66,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.206.2) + fastlane (2.208.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -106,9 +106,9 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.21.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-core (0.5.0) + google-apis-androidpublisher_v3 (0.25.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-core (0.7.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -117,27 +117,27 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-iamcredentials_v1 (0.10.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-playcustomapp_v1 (0.7.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-storage_v1 (0.14.0) - google-apis-core (>= 0.4, < 2.a) + google-apis-iamcredentials_v1 (0.13.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-playcustomapp_v1 (0.10.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-storage_v1 (0.17.0) + google-apis-core (>= 0.7, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.2.0) - google-cloud-storage (1.36.2) + google-cloud-storage (1.38.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.17.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.1.3) + googleauth (1.2.0) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -173,9 +173,9 @@ GEM ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) - signet (0.16.1) + signet (0.17.0) addressable (~> 2.8) - faraday (>= 0.17.5, < 3.0) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simctl (1.6.8) @@ -196,10 +196,10 @@ GEM unicode-display_width (1.8.0) webrick (1.7.0) word_wrap (1.0.0) - xcode-install (2.8.0) - claide (>= 0.9.1, < 1.1.0) + xcode-install (2.8.1) + claide (>= 0.9.1) fastlane (>= 2.1.0, < 3.0.0) - xcodeproj (1.21.0) + xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) From ffa3d169894004fa9c2d1d478bd3ad255a5b4b52 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Thu, 11 Aug 2022 19:08:34 +0200 Subject: [PATCH 13/15] Disable buggy Akamai test Probably not revenant anymore. --- .swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme index b4375a71..649dc8b3 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/SRGMediaPlayer.xcscheme @@ -69,6 +69,9 @@ ReferencedContainer = "container:"> + + From 66953ad1ce3a39653748eccd308de3f240c15736 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Thu, 11 Aug 2022 19:14:15 +0200 Subject: [PATCH 14/15] Update dependencies to official tags --- .../xcshareddata/swiftpm/Package.resolved | 14 +++++++------- Package.resolved | 14 +++++++------- Package.swift | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved index b4df51ea..17dd9091 100644 --- a/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/SRGMediaPlayer-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,27 +5,27 @@ "package": "libextobjc", "repositoryURL": "https://github.com/SRGSSR/libextobjc.git", "state": { - "branch": "master", + "branch": null, "revision": "9c9a7327410fe3f7cdb695965ced43b9a7766ee0", - "version": null + "version": "0.6.0-srg4" } }, { "package": "MAKVONotificationCenter", "repositoryURL": "https://github.com/SRGSSR/MAKVONotificationCenter.git", "state": { - "branch": "master", + "branch": null, "revision": "8bde3cdc872085bd31f4cfe546bdf8e6932a0806", - "version": null + "version": "1.0.0-srg6" } }, { "package": "SRGLogger", "repositoryURL": "https://github.com/SRGSSR/srglogger-apple.git", "state": { - "branch": "develop", - "revision": "3b7c04bccfb6714d2ea9589e98591ed9088d128e", - "version": null + "branch": null, + "revision": "dd98468422044b53e283d970809b8502e1ef5b8d", + "version": "3.1.0" } } ] diff --git a/Package.resolved b/Package.resolved index b4df51ea..17dd9091 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,27 +5,27 @@ "package": "libextobjc", "repositoryURL": "https://github.com/SRGSSR/libextobjc.git", "state": { - "branch": "master", + "branch": null, "revision": "9c9a7327410fe3f7cdb695965ced43b9a7766ee0", - "version": null + "version": "0.6.0-srg4" } }, { "package": "MAKVONotificationCenter", "repositoryURL": "https://github.com/SRGSSR/MAKVONotificationCenter.git", "state": { - "branch": "master", + "branch": null, "revision": "8bde3cdc872085bd31f4cfe546bdf8e6932a0806", - "version": null + "version": "1.0.0-srg6" } }, { "package": "SRGLogger", "repositoryURL": "https://github.com/SRGSSR/srglogger-apple.git", "state": { - "branch": "develop", - "revision": "3b7c04bccfb6714d2ea9589e98591ed9088d128e", - "version": null + "branch": null, + "revision": "dd98468422044b53e283d970809b8502e1ef5b8d", + "version": "3.1.0" } } ] diff --git a/Package.swift b/Package.swift index 3f6b7af3..eac28ac4 100644 --- a/Package.swift +++ b/Package.swift @@ -20,9 +20,9 @@ let package = Package( ) ], dependencies: [ - .package(name: "libextobjc", url: "https://github.com/SRGSSR/libextobjc.git", .branch("master")), - .package(name: "MAKVONotificationCenter", url: "https://github.com/SRGSSR/MAKVONotificationCenter.git", .branch("master")), - .package(name: "SRGLogger", url: "https://github.com/SRGSSR/srglogger-apple.git", .branch("develop")) + .package(name: "libextobjc", url: "https://github.com/SRGSSR/libextobjc.git", .exact("0.6.0-srg4")), + .package(name: "MAKVONotificationCenter", url: "https://github.com/SRGSSR/MAKVONotificationCenter.git", .exact("1.0.0-srg6")), + .package(name: "SRGLogger", url: "https://github.com/SRGSSR/srglogger-apple.git", .upToNextMinor(from: "3.1.0")) ], targets: [ .target( From 1f8f69185c1a771e07f2602cb7bcdacbb3998761 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Thu, 11 Aug 2022 19:15:05 +0200 Subject: [PATCH 15/15] Bump version number --- Demo/Demo.xcconfig | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Demo/Demo.xcconfig b/Demo/Demo.xcconfig index 017fc0a6..6fdb16fa 100644 --- a/Demo/Demo.xcconfig +++ b/Demo/Demo.xcconfig @@ -1,5 +1,5 @@ // Version information -MARKETING_VERSION = 7.0.4 +MARKETING_VERSION = 7.1.0 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index eac28ac4..55e180ca 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion: String = "7.0.4" + static let marketingVersion: String = "7.1.0" } let package = Package(