From 90024efa20c44bd704cb28bf5efc21c4c54a083e Mon Sep 17 00:00:00 2001 From: Walid Kayhal <3347810+waliid@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:45:32 +0200 Subject: [PATCH 01/11] Bump to version 9.1.2 --- Demo/Xcode/Shared/Targets/Application.xcconfig | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Demo/Xcode/Shared/Targets/Application.xcconfig b/Demo/Xcode/Shared/Targets/Application.xcconfig index 4834a5e5..04442cb4 100644 --- a/Demo/Xcode/Shared/Targets/Application.xcconfig +++ b/Demo/Xcode/Shared/Targets/Application.xcconfig @@ -1,8 +1,8 @@ #include "Xcode/Shared/Common.xcconfig" // Version information -MARKETING_VERSION = 9.1.1 -CURRENT_PROJECT_VERSION = 106 +MARKETING_VERSION = 9.1.2 +CURRENT_PROJECT_VERSION = 107 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index bbb77143..e7cddd02 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion = "9.1.1" + static let marketingVersion = "9.1.2" } let package = Package( From 1ee4f182eeff88d8136a92981fa348dc7bc922a7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Wed, 6 Sep 2023 13:57:25 +0200 Subject: [PATCH 02/11] Fix unit test for not found media urn (#307) --- Tests/SRGLetterboxTests/DiagnosticTestCase.m | 2 +- Tests/SRGLetterboxTests/PlaybackTestCase.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/SRGLetterboxTests/DiagnosticTestCase.m b/Tests/SRGLetterboxTests/DiagnosticTestCase.m index 59a1a244..4ce91ed9 100644 --- a/Tests/SRGLetterboxTests/DiagnosticTestCase.m +++ b/Tests/SRGLetterboxTests/DiagnosticTestCase.m @@ -140,7 +140,7 @@ - (void)testSinglePlaybackReportSubmission - (void)testPlaybackReportForUnknownMedia { - NSString *URN = @"urn:swi:video:_UNKNOWN_ID_"; + NSString *URN = @"urn:rts:video:1234"; [self expectationForSingleNotification:SRGLetterboxPlaybackDidFailNotification object:self.controller handler:^BOOL(NSNotification * _Nonnull notification) { return YES; diff --git a/Tests/SRGLetterboxTests/PlaybackTestCase.m b/Tests/SRGLetterboxTests/PlaybackTestCase.m index 775bef90..2dedc977 100644 --- a/Tests/SRGLetterboxTests/PlaybackTestCase.m +++ b/Tests/SRGLetterboxTests/PlaybackTestCase.m @@ -307,7 +307,7 @@ - (void)testPlayUnknownURN XCTAssertEqual(self.controller.dataAvailability, SRGLetterboxDataAvailabilityNone); XCTAssertFalse(self.controller.loading); - [self.controller playURN:@"urn:swi:video:_NO_ID_" atPosition:nil withPreferredSettings:nil]; + [self.controller playURN:@"urn:rts:video:1234" atPosition:nil withPreferredSettings:nil]; XCTAssertEqual(self.controller.dataAvailability, SRGLetterboxDataAvailabilityLoading); XCTAssertTrue(self.controller.loading); From a7fbce0ded42fe5fe30a90b0f84648314df7b154 Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Fri, 15 Sep 2023 15:24:07 +0200 Subject: [PATCH 03/11] Xcode 15 with iOS 17 and tvOS 17 (#300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Samuel DeĢfago Co-authored-by: Walid Kayhal <3347810+waliid@users.noreply.github.com> --- .xcode-version | 2 +- Sources/SRGLetterbox/SRGControlsView~ios.m | 16 ++++++++-------- .../SRGLetterbox/SRGLetterboxTimelineView~ios.m | 17 ++++------------- Sources/SRGLetterbox/SRGLetterboxView~ios.m | 2 ++ 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.xcode-version b/.xcode-version index 7ea95c24..3d3be3c3 100644 --- a/.xcode-version +++ b/.xcode-version @@ -1 +1 @@ -14.3.1 \ No newline at end of file +15.0 \ No newline at end of file diff --git a/Sources/SRGLetterbox/SRGControlsView~ios.m b/Sources/SRGLetterbox/SRGControlsView~ios.m index f928376d..f756e8a1 100644 --- a/Sources/SRGLetterbox/SRGControlsView~ios.m +++ b/Sources/SRGLetterbox/SRGControlsView~ios.m @@ -181,8 +181,8 @@ - (void)layoutTimeSliderInStackView:(UIStackView *)stackView timeSlider.translatesAutoresizingMaskIntoConstraints = NO; [NSLayoutConstraint activateConstraints:@[ - [timeSlider.leadingAnchor constraintEqualToAnchor:timeSliderWrapperView.leadingAnchor constant:11.f], - [timeSlider.trailingAnchor constraintEqualToAnchor:timeSliderWrapperView.trailingAnchor constant:-11.f], + [[timeSlider.leadingAnchor constraintEqualToAnchor:timeSliderWrapperView.leadingAnchor constant:11.f] srgletterbox_withPriority:999], + [[timeSlider.trailingAnchor constraintEqualToAnchor:timeSliderWrapperView.trailingAnchor constant:-11.f] srgletterbox_withPriority:999], [timeSlider.centerYAnchor constraintEqualToAnchor:timeSliderWrapperView.centerYAnchor], [timeSlider.heightAnchor constraintEqualToConstant:22.f] ]]; @@ -204,9 +204,9 @@ - (void)layoutDurationLabelInStackView:(UIStackView *)stackView durationLabel.translatesAutoresizingMaskIntoConstraints = NO; [NSLayoutConstraint activateConstraints:@[ - [durationLabel.leadingAnchor constraintEqualToAnchor:durationLabelWrapperView.leadingAnchor constant:11.f], - [durationLabel.trailingAnchor constraintEqualToAnchor:durationLabelWrapperView.trailingAnchor constant:-11.f], - [durationLabel.centerYAnchor constraintEqualToAnchor:durationLabelWrapperView.centerYAnchor] + [durationLabel.centerXAnchor constraintEqualToAnchor:durationLabelWrapperView.centerXAnchor], + [durationLabel.centerYAnchor constraintEqualToAnchor:durationLabelWrapperView.centerYAnchor], + [[durationLabelWrapperView.widthAnchor constraintEqualToConstant:48.f] srgletterbox_withPriority:999] ]]; } @@ -223,9 +223,9 @@ - (void)layoutLiveLabelInStackView:(UIStackView *)stackView liveLabel.translatesAutoresizingMaskIntoConstraints = NO; [NSLayoutConstraint activateConstraints:@[ - [liveLabel.leadingAnchor constraintEqualToAnchor:liveLabelWrapperView.leadingAnchor constant:11.f], - [liveLabel.trailingAnchor constraintEqualToAnchor:liveLabelWrapperView.trailingAnchor constant:-11.f], - [liveLabel.centerYAnchor constraintEqualToAnchor:liveLabelWrapperView.centerYAnchor] + [liveLabel.centerXAnchor constraintEqualToAnchor:liveLabelWrapperView.centerXAnchor], + [liveLabel.centerYAnchor constraintEqualToAnchor:liveLabelWrapperView.centerYAnchor], + [[liveLabelWrapperView.widthAnchor constraintEqualToConstant:70.f] srgletterbox_withPriority:999] ]]; } diff --git a/Sources/SRGLetterbox/SRGLetterboxTimelineView~ios.m b/Sources/SRGLetterbox/SRGLetterboxTimelineView~ios.m index 6835095a..cecb01ce 100644 --- a/Sources/SRGLetterbox/SRGLetterboxTimelineView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxTimelineView~ios.m @@ -47,7 +47,10 @@ - (void)layoutContentView UICollectionViewFlowLayout *collectionViewLayout = [[UICollectionViewFlowLayout alloc] init]; collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; collectionViewLayout.minimumLineSpacing = SRGLetterboxCellMargin; - + CGFloat height = SRGLetterboxTimelineViewDefaultHeight - 2 * SRGLetterboxCellMargin; + NSAssert(height > 0.f, @"Height must be positive"); + collectionViewLayout.itemSize = CGSizeMake(16.f / 13.f * height, height); + UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:self.contentView.bounds collectionViewLayout:collectionViewLayout]; collectionView.backgroundColor = UIColor.clearColor; collectionView.indicatorStyle = UIScrollViewIndicatorStyleWhite; @@ -101,18 +104,6 @@ - (void)setTime:(CMTime)time #pragma mark Overrides -- (void)layoutSubviews -{ - [super layoutSubviews]; - - UICollectionViewFlowLayout *collectionViewLayout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout; - CGFloat height = CGRectGetHeight(self.frame) - 2 * SRGLetterboxCellMargin; - CGFloat width = (height > 0) ? 16.f / 13.f * height : 10e-6f; // UICollectionViewFlowLayout doesn't allow CGSizeZero - collectionViewLayout.itemSize = CGSizeMake(width, height); - - [self.collectionView.collectionViewLayout invalidateLayout]; -} - - (void)contentSizeCategoryDidChange { [super contentSizeCategoryDidChange]; diff --git a/Sources/SRGLetterbox/SRGLetterboxView~ios.m b/Sources/SRGLetterbox/SRGLetterboxView~ios.m index 0f48fd4e..4d300333 100644 --- a/Sources/SRGLetterbox/SRGLetterboxView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxView~ios.m @@ -881,10 +881,12 @@ - (CGFloat)updateTimelineLayoutForUserInterfaceHidden:(BOOL)userInterfaceHidden if (isTimelineVisible) { self.timelineToSafeAreaBottomConstraint.priority = kBottomConstraintGreaterPriority; self.timelineToSelfBottomConstraint.priority = kBottomConstraintLesserPriority; + self.timelineView.alpha = 1.f; } else { self.timelineToSafeAreaBottomConstraint.priority = kBottomConstraintLesserPriority; self.timelineToSelfBottomConstraint.priority = kBottomConstraintGreaterPriority; + self.timelineView.alpha = 0.f; } return timelineHeight; From 4d5bf726584c45003a9164b4411833e1eba1a917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Sep 2023 15:29:41 +0200 Subject: [PATCH 04/11] Update what's new --- WhatsNew-demo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WhatsNew-demo.json b/WhatsNew-demo.json index d4b76bc1..dfa2ecfe 100644 --- a/WhatsNew-demo.json +++ b/WhatsNew-demo.json @@ -70,5 +70,6 @@ "8.4.0-103": "- Maintenance release for the library.\n- Demo: update Live Center section in list tab.", "9.0.0-104": "- Remove bit rate setting in the library.", "9.1.0-105": "- Update image provider. Updated artwork in control center.\n- Fix some crashes with UI controls and the slider.", - "9.1.1-106": "- Maintenance release for the library." + "9.1.1-106": "- Maintenance release for the library.", + "9.1.2-107": "- Fix slider layout issues on iOS 17." } From 1cef6d8a0750722ba3aa8d27402435aa0a97ca73 Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Fri, 15 Sep 2023 16:50:23 +0200 Subject: [PATCH 05/11] Update to Commanders Act version 5 (#297) --- Demo/Info.plist | 38 +++++++++---------- .../xcshareddata/swiftpm/Package.resolved | 31 ++++++--------- Demo/Sources/Application/AppDelegate.m | 10 ++--- .../Demos/AdvancedPlayerViewController.h | 2 +- .../Demos/AdvancedPlayerViewController~ios.m | 16 +++++++- Demo/Sources/Demos/FeedsViewController.h | 3 +- Demo/Sources/Demos/FeedsViewController~ios.m | 12 ++++++ Demo/Sources/Demos/ListsViewController.h | 3 +- Demo/Sources/Demos/ListsViewController.m | 12 ++++++ Demo/Sources/Demos/MediaListViewController.h | 3 +- Demo/Sources/Demos/MediaListViewController.m | 12 ++++++ Demo/Sources/Demos/MediasViewController.h | 3 +- Demo/Sources/Demos/MediasViewController.m | 12 ++++++ .../Demos/MiscellaneousViewController.h | 3 +- .../Demos/MiscellaneousViewController~ios.m | 12 ++++++ .../Sources/Demos/MultiPlayerViewController.h | 2 +- .../Demos/MultiPlayerViewController~ios.m | 16 +++++++- Demo/Sources/Demos/PlayerPageViewController.h | 3 +- .../Demos/PlayerPageViewController~ios.m | 12 ++++++ Demo/Sources/Demos/PlaylistViewController.h | 2 +- .../Demos/PlaylistViewController~ios.m | 16 +++++++- Demo/Sources/Demos/SettingsViewController.h | 3 +- Demo/Sources/Demos/SettingsViewController.m | 12 ++++++ .../Demos/SimplePlayerViewController.h | 3 +- .../Demos/SimplePlayerViewController~ios.m | 12 ++++++ .../Demos/StandalonePlayerViewController.h | 2 +- .../StandalonePlayerViewController~ios.m | 16 +++++++- Demo/Sources/Demos/TopicListViewController.h | 3 +- Demo/Sources/Demos/TopicListViewController.m | 12 ++++++ Package.resolved | 31 ++++++--------- Package.swift | 4 +- Sources/SRGLetterbox/NSBundle+SRGLetterbox.h | 9 ----- Sources/SRGLetterbox/NSBundle+SRGLetterbox.m | 20 ---------- Sources/SRGLetterbox/SRGLetterboxController.m | 7 ---- Sources/SRGLetterbox/SRGLetterboxView~ios.m | 5 --- Tests/SRGLetterboxTests/DiagnosticTestCase.m | 36 +++--------------- Tests/SRGLetterboxTests/MetadataTestCase.m | 6 +++ Tests/SRGLetterboxTests/PlaybackTestCase.m | 6 +++ Tests/SRGLetterboxTests/PlaylistsTestCase.m | 6 +++ Tests/SRGLetterboxTests/RateTestCase.m | 6 +++ Tests/SRGLetterboxTests/SkipTestCase.m | 6 +++ Tests/SRGLetterboxTests/SocialCountTestCase.m | 6 +++ Tests/SRGLetterboxTests/SourceUidTestCase.m | 6 +++ Tests/SRGLetterboxTests/SwissTXTTestCase.m | 6 +++ Tests/SRGLetterboxTests/SwitchTestCase.m | 6 +++ .../SRGLetterboxTests/TrackerSingletonSetup.h | 13 +++++++ .../SRGLetterboxTests/TrackerSingletonSetup.m | 10 ++--- docs/FEATURES.md | 2 +- 48 files changed, 312 insertions(+), 165 deletions(-) create mode 100644 Tests/SRGLetterboxTests/TrackerSingletonSetup.h diff --git a/Demo/Info.plist b/Demo/Info.plist index 71a23fef..229b29ac 100644 --- a/Demo/Info.plist +++ b/Demo/Info.plist @@ -2,6 +2,8 @@ + AVInitialRouteSharingPolicy + LongFormVideo AppCenterSecret $(APPCENTER_SECRET) AppCenterURL @@ -53,6 +55,23 @@ PlayMMFServiceURL $(PLAY_MMF_SERVICE_URL) + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default + UISceneDelegateClassName + SceneDelegate + + + + UIBackgroundModes audio @@ -78,26 +97,7 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - AVInitialRouteSharingPolicy - LongFormVideo UIUserInterfaceStyle Automatic - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default - UISceneDelegateClassName - SceneDelegate - - - - diff --git a/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved index c196d9f6..b683db49 100644 --- a/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -28,6 +28,15 @@ "version": "1.3.2-srg6" } }, + { + "package": "TagCommander SDK V5", + "repositoryURL": "https://github.com/CommandersAct/iOSV5.git", + "state": { + "branch": null, + "revision": "2e56e97db76d55657d0dc7d13e2fcd81ce4eaa6c", + "version": "5.3.3" + } + }, { "package": "libextobjc", "repositoryURL": "https://github.com/SRGSSR/libextobjc.git", @@ -78,8 +87,8 @@ "repositoryURL": "https://github.com/SRGSSR/srganalytics-apple.git", "state": { "branch": null, - "revision": "c92014ca8838ad3cf403735ce25757afb04cd31f", - "version": "8.2.0" + "revision": "5b42f334290ee3268f61b62d02e509ec74f4a721", + "version": "9.0.0" } }, { @@ -154,24 +163,6 @@ "version": "3.1.0" } }, - { - "package": "TCCore", - "repositoryURL": "https://github.com/SRGSSR/TCCore-xcframework-apple.git", - "state": { - "branch": null, - "revision": "eb686883e63af28174472a09eda97acf07179c88", - "version": "4.5.4-srg5" - } - }, - { - "package": "TCSDK", - "repositoryURL": "https://github.com/SRGSSR/TCSDK-xcframework-apple.git", - "state": { - "branch": null, - "revision": "c4becb0b250258b78cb46225af5e269da834db5a", - "version": "4.4.1-srg5" - } - }, { "package": "UICKeyChainStore", "repositoryURL": "https://github.com/kishikawakatsumi/UICKeyChainStore.git", diff --git a/Demo/Sources/Application/AppDelegate.m b/Demo/Sources/Application/AppDelegate.m index e1ab7d01..d9812eab 100644 --- a/Demo/Sources/Application/AppDelegate.m +++ b/Demo/Sources/Application/AppDelegate.m @@ -45,13 +45,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( SRGLetterboxService.sharedService.mirroredOnExternalScreen = ApplicationSettingIsMirroredOnExternalScreen(); #endif - // Use test setup and pre-production mode since there will never be any public App Store version of this demo application. - // This prevents tvOS builds delivered with TestFlight from sending production data. - SRGAnalyticsConfiguration *configuration = [[SRGAnalyticsConfiguration alloc] initWithBusinessUnitIdentifier:SRGAnalyticsBusinessUnitIdentifierRTS - container:10 - siteName:@"rts-app-test-v"]; + // Use a debug source key since there will never be any public App Store version of this demo application. + SRGAnalyticsConfiguration *configuration = [[SRGAnalyticsConfiguration alloc] initWithBusinessUnitIdentifier:SRGAnalyticsBusinessUnitIdentifierSRG + sourceKey:@"39ae8f94-595c-4ca4-81f7-fb7748bd3f04" + siteName:@"srg-app-letterbox-apple"]; configuration.centralized = YES; - configuration.environmentMode = SRGAnalyticsEnvironmentModePreProduction; [[SRGAnalyticsTracker sharedTracker] startWithConfiguration:configuration]; diff --git a/Demo/Sources/Demos/AdvancedPlayerViewController.h b/Demo/Sources/Demos/AdvancedPlayerViewController.h index 04b3ec1b..31b8d4c5 100644 --- a/Demo/Sources/Demos/AdvancedPlayerViewController.h +++ b/Demo/Sources/Demos/AdvancedPlayerViewController.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface AdvancedPlayerViewController : UIViewController +@interface AdvancedPlayerViewController : UIViewController // If `media` is set, `URN` is ignored. - (instancetype)initWithURN:(nullable NSString *)URN media:(nullable SRGMedia *)media serviceURL:(nullable NSURL *)serviceURL; diff --git a/Demo/Sources/Demos/AdvancedPlayerViewController~ios.m b/Demo/Sources/Demos/AdvancedPlayerViewController~ios.m index 1e7978a2..a4387c11 100644 --- a/Demo/Sources/Demos/AdvancedPlayerViewController~ios.m +++ b/Demo/Sources/Demos/AdvancedPlayerViewController~ios.m @@ -290,6 +290,18 @@ - (void)reloadDataOverriddenWithMedia:(SRGMedia *)media self.URNLabel.text = media.URN; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Advanced Player"; +} + +- (NSString *)srg_pageViewType +{ + return @"Detail"; +} + #pragma mark SRGLetterboxPictureInPictureDelegate protocol - (BOOL)letterboxDismissUserInterfaceForPictureInPicture @@ -314,12 +326,12 @@ - (void)letterboxRestoreUserInterfaceForPictureInPictureWithCompletionHandler:(v - (void)letterboxDidStartPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_start"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_start"]; } - (void)letterboxDidEndPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_end"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_end"]; } - (void)letterboxDidStopPlaybackFromPictureInPicture diff --git a/Demo/Sources/Demos/FeedsViewController.h b/Demo/Sources/Demos/FeedsViewController.h index 2436a7f9..38d8589e 100644 --- a/Demo/Sources/Demos/FeedsViewController.h +++ b/Demo/Sources/Demos/FeedsViewController.h @@ -4,6 +4,7 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN @@ -27,7 +28,7 @@ typedef API_UNAVAILABLE(tvos) NS_ENUM(NSInteger, Feed) { }; API_UNAVAILABLE(tvos) -@interface FeedsViewController : UIViewController +@interface FeedsViewController : UIViewController @property (nonatomic) Feed feed; diff --git a/Demo/Sources/Demos/FeedsViewController~ios.m b/Demo/Sources/Demos/FeedsViewController~ios.m index 02739679..b9af9364 100644 --- a/Demo/Sources/Demos/FeedsViewController~ios.m +++ b/Demo/Sources/Demos/FeedsViewController~ios.m @@ -152,6 +152,18 @@ - (void)updateAudioSession } } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Feeds"; +} + +- (NSString *)srg_pageViewType +{ + return @"Detail"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section diff --git a/Demo/Sources/Demos/ListsViewController.h b/Demo/Sources/Demos/ListsViewController.h index a5902361..9da3d8eb 100644 --- a/Demo/Sources/Demos/ListsViewController.h +++ b/Demo/Sources/Demos/ListsViewController.h @@ -4,11 +4,12 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN -@interface ListsViewController : UITableViewController +@interface ListsViewController : UITableViewController @end diff --git a/Demo/Sources/Demos/ListsViewController.m b/Demo/Sources/Demos/ListsViewController.m index d73502ab..0ddfbbb3 100644 --- a/Demo/Sources/Demos/ListsViewController.m +++ b/Demo/Sources/Demos/ListsViewController.m @@ -36,6 +36,18 @@ - (void)viewDidLoad #endif } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Lists"; +} + +- (NSString *)srg_pageViewType +{ + return @"LandingPage"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView diff --git a/Demo/Sources/Demos/MediaListViewController.h b/Demo/Sources/Demos/MediaListViewController.h index 0effc5b4..20f0e0a5 100644 --- a/Demo/Sources/Demos/MediaListViewController.h +++ b/Demo/Sources/Demos/MediaListViewController.h @@ -4,6 +4,7 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import SRGDataProviderModel; @import UIKit; @@ -175,7 +176,7 @@ typedef NS_ENUM(NSInteger, MediaList) { MediaListLiveWebRTR }; -@interface MediaListViewController : UITableViewController +@interface MediaListViewController : UITableViewController - (instancetype)initWithMediaList:(MediaList)mediaList topic:(nullable SRGTopic *)topic serviceURL:(nullable NSURL *)serviceURL; diff --git a/Demo/Sources/Demos/MediaListViewController.m b/Demo/Sources/Demos/MediaListViewController.m index e98f2e18..574dcd44 100644 --- a/Demo/Sources/Demos/MediaListViewController.m +++ b/Demo/Sources/Demos/MediaListViewController.m @@ -348,6 +348,18 @@ - (void)refresh self.request = request; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Media List"; +} + +- (NSString *)srg_pageViewType +{ + return @"Overview"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section diff --git a/Demo/Sources/Demos/MediasViewController.h b/Demo/Sources/Demos/MediasViewController.h index b8f744ed..3869fb47 100644 --- a/Demo/Sources/Demos/MediasViewController.h +++ b/Demo/Sources/Demos/MediasViewController.h @@ -4,11 +4,12 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN -@interface MediasViewController : UITableViewController +@interface MediasViewController : UITableViewController @end diff --git a/Demo/Sources/Demos/MediasViewController.m b/Demo/Sources/Demos/MediasViewController.m index a7733595..35c39174 100644 --- a/Demo/Sources/Demos/MediasViewController.m +++ b/Demo/Sources/Demos/MediasViewController.m @@ -62,6 +62,18 @@ - (void)openCustomURNEntryAlertWithCompletionBlock:(void (^)(NSString * _Nullabl [self presentViewController:alertController animated:YES completion:nil]; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Medias"; +} + +- (NSString *)srg_pageViewType +{ + return @"LandingPage"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView diff --git a/Demo/Sources/Demos/MiscellaneousViewController.h b/Demo/Sources/Demos/MiscellaneousViewController.h index 164f4e74..36b45340 100644 --- a/Demo/Sources/Demos/MiscellaneousViewController.h +++ b/Demo/Sources/Demos/MiscellaneousViewController.h @@ -4,12 +4,13 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface MiscellaneousViewController : UITableViewController +@interface MiscellaneousViewController : UITableViewController @end diff --git a/Demo/Sources/Demos/MiscellaneousViewController~ios.m b/Demo/Sources/Demos/MiscellaneousViewController~ios.m index 159f6218..e43d7ba9 100644 --- a/Demo/Sources/Demos/MiscellaneousViewController~ios.m +++ b/Demo/Sources/Demos/MiscellaneousViewController~ios.m @@ -120,6 +120,18 @@ - (void)openPlayerPagesWithURNs:(NSArray *)URNs [self.navigationController pushViewController:pageViewController animated:YES]; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Miscellaneous"; +} + +- (NSString *)srg_pageViewType +{ + return @"LandingPage"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView diff --git a/Demo/Sources/Demos/MultiPlayerViewController.h b/Demo/Sources/Demos/MultiPlayerViewController.h index e5cd8e26..92923634 100644 --- a/Demo/Sources/Demos/MultiPlayerViewController.h +++ b/Demo/Sources/Demos/MultiPlayerViewController.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface MultiPlayerViewController : UIViewController +@interface MultiPlayerViewController : UIViewController - (instancetype)initWithURN:(nullable NSString *)URN URN1:(nullable NSString *)URN1 URN2:(nullable NSString *)URN2 userInterfaceAlwaysHidden:(BOOL)userInterfaceAlwaysHidden; diff --git a/Demo/Sources/Demos/MultiPlayerViewController~ios.m b/Demo/Sources/Demos/MultiPlayerViewController~ios.m index 55dd882b..3fda0802 100644 --- a/Demo/Sources/Demos/MultiPlayerViewController~ios.m +++ b/Demo/Sources/Demos/MultiPlayerViewController~ios.m @@ -155,6 +155,18 @@ - (BOOL)accessibilityPerformEscape return YES; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Multi Player"; +} + +- (NSString *)srg_pageViewType +{ + return @"Detail"; +} + #pragma mark SRGLetterboxPictureInPictureDelegate protocol - (BOOL)letterboxDismissUserInterfaceForPictureInPicture @@ -179,12 +191,12 @@ - (void)letterboxRestoreUserInterfaceForPictureInPictureWithCompletionHandler:(v - (void)letterboxDidStartPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_start"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_start"]; } - (void)letterboxDidEndPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_end"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_end"]; } - (void)letterboxDidStopPlaybackFromPictureInPicture diff --git a/Demo/Sources/Demos/PlayerPageViewController.h b/Demo/Sources/Demos/PlayerPageViewController.h index e4a0bac8..4d29f41d 100644 --- a/Demo/Sources/Demos/PlayerPageViewController.h +++ b/Demo/Sources/Demos/PlayerPageViewController.h @@ -4,12 +4,13 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface PlayerPageViewController : UIViewController +@interface PlayerPageViewController : UIViewController - (instancetype)initWithURN:(NSString *)URN; diff --git a/Demo/Sources/Demos/PlayerPageViewController~ios.m b/Demo/Sources/Demos/PlayerPageViewController~ios.m index 1aadc5e3..c4e9f8d4 100644 --- a/Demo/Sources/Demos/PlayerPageViewController~ios.m +++ b/Demo/Sources/Demos/PlayerPageViewController~ios.m @@ -91,6 +91,18 @@ - (BOOL)prefersHomeIndicatorAutoHidden return self.letterboxView.userInterfaceHidden; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Page Navigation Player"; +} + +- (NSString *)srg_pageViewType +{ + return @"Detail"; +} + #pragma mark SRGLetterboxViewDelegate protocol - (void)letterboxViewWillAnimateUserInterface:(SRGLetterboxView *)letterboxView diff --git a/Demo/Sources/Demos/PlaylistViewController.h b/Demo/Sources/Demos/PlaylistViewController.h index b88b9ff8..21d9d618 100644 --- a/Demo/Sources/Demos/PlaylistViewController.h +++ b/Demo/Sources/Demos/PlaylistViewController.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface PlaylistViewController : UIViewController +@interface PlaylistViewController : UIViewController - (instancetype)initWithMedias:(nullable NSArray *)medias sourceUid:(nullable NSString *)sourceUid; diff --git a/Demo/Sources/Demos/PlaylistViewController~ios.m b/Demo/Sources/Demos/PlaylistViewController~ios.m index a070165e..9d441ca9 100644 --- a/Demo/Sources/Demos/PlaylistViewController~ios.m +++ b/Demo/Sources/Demos/PlaylistViewController~ios.m @@ -143,6 +143,18 @@ - (void)updateContinuousPlaybackLabelWithText:(NSString *)text }]; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Playlist"; +} + +- (NSString *)srg_pageViewType +{ + return @"Overview"; +} + #pragma mark SRGLetterboxPictureInPictureDelegate protocol - (BOOL)letterboxDismissUserInterfaceForPictureInPicture @@ -172,12 +184,12 @@ - (void)letterboxDidStopPlaybackFromPictureInPicture - (void)letterboxDidStartPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_start"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_start"]; } - (void)letterboxDidEndPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_end"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_end"]; } #pragma mark SRGLetterboxViewDelegate protocol diff --git a/Demo/Sources/Demos/SettingsViewController.h b/Demo/Sources/Demos/SettingsViewController.h index 22e1d33e..96b86b99 100644 --- a/Demo/Sources/Demos/SettingsViewController.h +++ b/Demo/Sources/Demos/SettingsViewController.h @@ -6,6 +6,7 @@ #include "ServerSettings.h" +@import SRGAnalytics; @import SRGDataProviderModel; @import UIKit; @@ -29,7 +30,7 @@ OBJC_EXPORT NSTimeInterval const LetterboxDemoSettingUpdateIntervalShort; OBJC_EXPORT API_UNAVAILABLE(tvos) BOOL ApplicationSettingIsBackgroundVideoPlaybackEnabled(void); OBJC_EXPORT BOOL ApplicationSettingPrefersMediaContentEnabled(void); -@interface SettingsViewController : UITableViewController +@interface SettingsViewController : UITableViewController @end diff --git a/Demo/Sources/Demos/SettingsViewController.m b/Demo/Sources/Demos/SettingsViewController.m index 369615cd..3b72a5dc 100644 --- a/Demo/Sources/Demos/SettingsViewController.m +++ b/Demo/Sources/Demos/SettingsViewController.m @@ -275,6 +275,18 @@ - (void)clearWebCache [cache.diskCache removeAllObjects]; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Settings"; +} + +- (NSString *)srg_pageViewType +{ + return @"LandingPage"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView diff --git a/Demo/Sources/Demos/SimplePlayerViewController.h b/Demo/Sources/Demos/SimplePlayerViewController.h index abd9e060..51408a72 100644 --- a/Demo/Sources/Demos/SimplePlayerViewController.h +++ b/Demo/Sources/Demos/SimplePlayerViewController.h @@ -4,12 +4,13 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface SimplePlayerViewController : UIViewController +@interface SimplePlayerViewController : UIViewController - (instancetype)initWithURN:(nullable NSString *)URN; diff --git a/Demo/Sources/Demos/SimplePlayerViewController~ios.m b/Demo/Sources/Demos/SimplePlayerViewController~ios.m index 25fa7d79..1c6678fe 100644 --- a/Demo/Sources/Demos/SimplePlayerViewController~ios.m +++ b/Demo/Sources/Demos/SimplePlayerViewController~ios.m @@ -91,6 +91,18 @@ - (BOOL)accessibilityPerformEscape return YES; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Simple Player"; +} + +- (NSString *)srg_pageViewType +{ + return @"Detail"; +} + #pragma mark SRGLetterboxViewDelegate protocol - (void)letterboxViewWillAnimateUserInterface:(SRGLetterboxView *)letterboxView diff --git a/Demo/Sources/Demos/StandalonePlayerViewController.h b/Demo/Sources/Demos/StandalonePlayerViewController.h index 6e5517e4..0fd55556 100644 --- a/Demo/Sources/Demos/StandalonePlayerViewController.h +++ b/Demo/Sources/Demos/StandalonePlayerViewController.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN API_UNAVAILABLE(tvos) -@interface StandalonePlayerViewController : UIViewController +@interface StandalonePlayerViewController : UIViewController - (instancetype)initWithURN:(nullable NSString *)URN; diff --git a/Demo/Sources/Demos/StandalonePlayerViewController~ios.m b/Demo/Sources/Demos/StandalonePlayerViewController~ios.m index 7502bc58..180589ed 100644 --- a/Demo/Sources/Demos/StandalonePlayerViewController~ios.m +++ b/Demo/Sources/Demos/StandalonePlayerViewController~ios.m @@ -114,6 +114,18 @@ - (BOOL)accessibilityPerformEscape return YES; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Standalone Player"; +} + +- (NSString *)srg_pageViewType +{ + return @"Detail"; +} + #pragma mark SRGLetterboxPictureInPictureDelegate protocol - (BOOL)letterboxDismissUserInterfaceForPictureInPicture @@ -138,12 +150,12 @@ - (void)letterboxRestoreUserInterfaceForPictureInPictureWithCompletionHandler:(v - (void)letterboxDidStartPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_start"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_start"]; } - (void)letterboxDidEndPictureInPicture { - [[SRGAnalyticsTracker sharedTracker] trackHiddenEventWithName:@"pip_end"]; + [[SRGAnalyticsTracker sharedTracker] trackEventWithName:@"pip_end"]; } - (void)letterboxDidStopPlaybackFromPictureInPicture diff --git a/Demo/Sources/Demos/TopicListViewController.h b/Demo/Sources/Demos/TopicListViewController.h index 4466d4c5..4f04bd65 100644 --- a/Demo/Sources/Demos/TopicListViewController.h +++ b/Demo/Sources/Demos/TopicListViewController.h @@ -4,6 +4,7 @@ // License information is available from the LICENSE file. // +@import SRGAnalytics; @import UIKit; NS_ASSUME_NONNULL_BEGIN @@ -42,7 +43,7 @@ typedef NS_ENUM(NSInteger, TopicList) { TopicListMMF }; -@interface TopicListViewController : UITableViewController +@interface TopicListViewController : UITableViewController - (instancetype)initWithTopicList:(TopicList)topicList; diff --git a/Demo/Sources/Demos/TopicListViewController.m b/Demo/Sources/Demos/TopicListViewController.m index 27878f03..3129d530 100644 --- a/Demo/Sources/Demos/TopicListViewController.m +++ b/Demo/Sources/Demos/TopicListViewController.m @@ -145,6 +145,18 @@ - (SRGVendor)vendor return vendorNumber.integerValue; } +#pragma mark SRGAnalyticsViewTracking protocol + +- (NSString *)srg_pageViewTitle +{ + return @"Topic List"; +} + +- (NSString *)srg_pageViewType +{ + return @"Overview"; +} + #pragma mark UITableViewDataSource protocol - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section diff --git a/Package.resolved b/Package.resolved index e69f30bb..a4e00282 100644 --- a/Package.resolved +++ b/Package.resolved @@ -19,6 +19,15 @@ "version": "1.3.2-srg6" } }, + { + "package": "TagCommander SDK V5", + "repositoryURL": "https://github.com/CommandersAct/iOSV5.git", + "state": { + "branch": null, + "revision": "2e56e97db76d55657d0dc7d13e2fcd81ce4eaa6c", + "version": "5.3.3" + } + }, { "package": "libextobjc", "repositoryURL": "https://github.com/SRGSSR/libextobjc.git", @@ -60,8 +69,8 @@ "repositoryURL": "https://github.com/SRGSSR/srganalytics-apple.git", "state": { "branch": null, - "revision": "c92014ca8838ad3cf403735ce25757afb04cd31f", - "version": "8.2.0" + "revision": "5b42f334290ee3268f61b62d02e509ec74f4a721", + "version": "9.0.0" } }, { @@ -136,24 +145,6 @@ "version": "3.1.0" } }, - { - "package": "TCCore", - "repositoryURL": "https://github.com/SRGSSR/TCCore-xcframework-apple.git", - "state": { - "branch": null, - "revision": "eb686883e63af28174472a09eda97acf07179c88", - "version": "4.5.4-srg5" - } - }, - { - "package": "TCSDK", - "repositoryURL": "https://github.com/SRGSSR/TCSDK-xcframework-apple.git", - "state": { - "branch": null, - "revision": "c4becb0b250258b78cb46225af5e269da834db5a", - "version": "4.4.1-srg5" - } - }, { "package": "UICKeyChainStore", "repositoryURL": "https://github.com/kishikawakatsumi/UICKeyChainStore.git", diff --git a/Package.swift b/Package.swift index e7cddd02..8f8f4b96 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion = "9.1.2" + static let marketingVersion = "9.1.1" } let package = Package( @@ -22,7 +22,7 @@ let package = Package( dependencies: [ .package(name: "FXReachability", url: "https://github.com/SRGSSR/FXReachability.git", .exact("1.3.2-srg6")), .package(name: "OHHTTPStubs", url: "https://github.com/AliSoftware/OHHTTPStubs.git", .upToNextMajor(from: "9.0.0")), - .package(name: "SRGAnalytics", url: "https://github.com/SRGSSR/srganalytics-apple.git", .upToNextMinor(from: "8.2.0")), + .package(name: "SRGAnalytics", url: "https://github.com/SRGSSR/srganalytics-apple.git", .upToNextMinor(from: "9.0.0")), .package(name: "SRGAppearance", url: "https://github.com/SRGSSR/srgappearance-apple.git", .upToNextMinor(from: "5.2.0")), .package(name: "YYWebImage", url: "https://github.com/SRGSSR/YYWebImage.git", .exact("1.0.5-srg3")) ], diff --git a/Sources/SRGLetterbox/NSBundle+SRGLetterbox.h b/Sources/SRGLetterbox/NSBundle+SRGLetterbox.h index 925bcefa..c4880499 100644 --- a/Sources/SRGLetterbox/NSBundle+SRGLetterbox.h +++ b/Sources/SRGLetterbox/NSBundle+SRGLetterbox.h @@ -26,13 +26,4 @@ NS_ASSUME_NONNULL_BEGIN __attribute__((annotate("returns_localized_nsstring"))) OBJC_EXPORT NSString *SRGLetterboxNonLocalizedString(NSString *string); -@interface NSBundle (SRGLetterbox) - -/** - * Return `YES` iff the application bundle corresponds to an AppStore or TestFlight release. - */ -@property (class, nonatomic, readonly) BOOL srg_letterbox_isProductionVersion; - -@end - NS_ASSUME_NONNULL_END diff --git a/Sources/SRGLetterbox/NSBundle+SRGLetterbox.m b/Sources/SRGLetterbox/NSBundle+SRGLetterbox.m index a9993358..1bd9c906 100644 --- a/Sources/SRGLetterbox/NSBundle+SRGLetterbox.m +++ b/Sources/SRGLetterbox/NSBundle+SRGLetterbox.m @@ -12,23 +12,3 @@ { return string; } - -@implementation NSBundle (SRGLetterbox) - -#pragma mark Class methods - -+ (BOOL)srg_letterbox_isProductionVersion -{ - if (NSProcessInfo.processInfo.environment[@"SIMULATOR_DEVICE_NAME"] - || [UIDevice.currentDevice.name.lowercaseString containsString:@"simulator"]) { - return NO; - } - - if ([NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]) { - return NO; - } - - return (NSBundle.mainBundle.appStoreReceiptURL != nil); -} - -@end diff --git a/Sources/SRGLetterbox/SRGLetterboxController.m b/Sources/SRGLetterbox/SRGLetterboxController.m index 09fae697..6243d6eb 100644 --- a/Sources/SRGLetterbox/SRGLetterboxController.m +++ b/Sources/SRGLetterbox/SRGLetterboxController.m @@ -576,12 +576,6 @@ - (BOOL)isUsingAirPlay return AVAudioSession.srg_isAirPlayActive && (self.media.mediaType == SRGMediaTypeAudio || self.mediaPlayerController.player.externalPlaybackActive); } -- (BOOL)isProductionVersion -{ - SRGAnalyticsConfiguration *analyticsConfiguration = SRGAnalyticsTracker.sharedTracker.configuration; - return analyticsConfiguration ? analyticsConfiguration.environment == SRGAnalyticsEnvironmentProduction : NSBundle.srg_letterbox_isProductionVersion; -} - - (void)setReport:(SRGDiagnosticReport *)report { [_report discard]; @@ -1640,7 +1634,6 @@ - (SRGDiagnosticReport *)startPlaybackDiagnosticReportForService:(NSString *)ser #else [report setString:[NSString stringWithFormat:@"Letterbox/iOS/%@", SRGLetterboxMarketingVersion()] forKey:@"player"]; #endif - [report setString:[self isProductionVersion] ? @"prod" : @"preprod" forKey:@"environment"]; [report setString:SRGDeviceInformation() forKey:@"device"]; [report setString:NSBundle.mainBundle.bundleIdentifier forKey:@"browser"]; [report setString:self.usingAirPlay ? @"airplay" : @"local" forKey:@"screenType"]; diff --git a/Sources/SRGLetterbox/SRGLetterboxView~ios.m b/Sources/SRGLetterbox/SRGLetterboxView~ios.m index 4d300333..4ae3a948 100644 --- a/Sources/SRGLetterbox/SRGLetterboxView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxView~ios.m @@ -791,11 +791,6 @@ - (BOOL)updateMainLayout BOOL playerViewVisible = (self.controller.media.mediaType == SRGMediaTypeVideo && mediaPlayerController.view.readyForDisplay && ! mediaPlayerController.externalNonMirroredPlaybackActive && playbackState != SRGMediaPlayerPlaybackStateIdle && playbackState != SRGMediaPlayerPlaybackStatePreparing && playbackState != SRGMediaPlayerPlaybackStateEnded); - // Prevent capture in production builds - if (NSBundle.srg_letterbox_isProductionVersion && UIScreen.mainScreen.captured && ! AVAudioSession.srg_isAirPlayActive) { - playerViewVisible = NO; - } - // Reset to aspect fit gravity if the updated layout does not support aspect fill anymore if (! [self supportsAspectFillVideoGravity]) { self.controller.mediaPlayerController.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect; diff --git a/Tests/SRGLetterboxTests/DiagnosticTestCase.m b/Tests/SRGLetterboxTests/DiagnosticTestCase.m index 4ce91ed9..f9668683 100644 --- a/Tests/SRGLetterboxTests/DiagnosticTestCase.m +++ b/Tests/SRGLetterboxTests/DiagnosticTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import libextobjc; @import OHHTTPStubs; @@ -34,6 +35,11 @@ @implementation DiagnosticTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.dataProvider = [[SRGDataProvider alloc] initWithServiceURL:SRGIntegrationLayerProductionServiceURL()]; @@ -83,7 +89,6 @@ - (void)testPlaybackReportForNonProtectedMedia XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -155,7 +160,6 @@ - (void)testPlaybackReportForUnknownMedia XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -197,7 +201,6 @@ - (void)testPlaybackReportForBlockedMedia XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -246,7 +249,6 @@ - (void)testPlaybackReportForUnplayableMedia XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -322,7 +324,6 @@ - (void)testPlaybackReportForTokenProtectedMedia XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -617,7 +618,6 @@ - (void)testPlaybackReportForNonProtectedMediaChangedURN XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -666,7 +666,6 @@ - (void)testPlaybackReportForTokenProtectedMediaChangedURN XCTAssertEqualObjects(JSONDictionary[@"browser"], NSBundle.mainBundle.bundleIdentifier); NSString *playerName = [NSString stringWithFormat:@"Letterbox/%@/%@", DiagnosticTestCasePlatform, SRGLetterboxMarketingVersion()]; XCTAssertEqualObjects(JSONDictionary[@"player"], playerName); - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"preprod"); XCTAssertNotNil(JSONDictionary[@"clientTime"]); XCTAssertNotNil(JSONDictionary[@"device"]); @@ -701,27 +700,4 @@ - (void)testPlaybackReportForTokenProtectedMediaChangedURN [self waitForExpectationsWithTimeout:30. handler:nil]; } -- (void)testPlaybackReportForForcedAnalyticsEnvironmentMode -{ - NSString *URN = OnDemandVideoURN; - - SRGAnalyticsEnvironmentMode originalAnalyticsEnvironmentMode = SRGAnalyticsTracker.sharedTracker.configuration.environmentMode; - SRGAnalyticsTracker.sharedTracker.configuration.environmentMode = SRGAnalyticsEnvironmentModeProduction; - - [self expectationForSingleNotification:SRGLetterboxPlaybackStateDidChangeNotification object:self.controller handler:^BOOL(NSNotification * _Nonnull notification) { - return [notification.userInfo[SRGMediaPlayerPlaybackStateKey] integerValue] == SRGMediaPlayerPlaybackStatePlaying; - }]; - [self expectationForSingleNotification:DiagnosticTestDidSendReportNotification object:nil handler:^BOOL(NSNotification * _Nonnull notification) { - NSDictionary *JSONDictionary = notification.userInfo[DiagnosticTestJSONDictionaryKey]; - XCTAssertEqualObjects(JSONDictionary[@"environment"], @"prod"); - return YES; - }]; - - [self.controller playURN:URN atPosition:nil withPreferredSettings:nil]; - - [self waitForExpectationsWithTimeout:30. handler:nil]; - - SRGAnalyticsTracker.sharedTracker.configuration.environmentMode = originalAnalyticsEnvironmentMode; -} - @end diff --git a/Tests/SRGLetterboxTests/MetadataTestCase.m b/Tests/SRGLetterboxTests/MetadataTestCase.m index 0ac75ae9..e0b323e6 100644 --- a/Tests/SRGLetterboxTests/MetadataTestCase.m +++ b/Tests/SRGLetterboxTests/MetadataTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import libextobjc; @import SRGLetterbox; @@ -22,6 +23,11 @@ @implementation MetadataTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/PlaybackTestCase.m b/Tests/SRGLetterboxTests/PlaybackTestCase.m index 2dedc977..cf321d36 100644 --- a/Tests/SRGLetterboxTests/PlaybackTestCase.m +++ b/Tests/SRGLetterboxTests/PlaybackTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import libextobjc; @import SRGDataProviderNetwork; @@ -23,6 +24,11 @@ @implementation PlaybackTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/PlaylistsTestCase.m b/Tests/SRGLetterboxTests/PlaylistsTestCase.m index 6157ae6b..7c77bb84 100644 --- a/Tests/SRGLetterboxTests/PlaylistsTestCase.m +++ b/Tests/SRGLetterboxTests/PlaylistsTestCase.m @@ -6,6 +6,7 @@ #import "LetterboxBaseTestCase.h" #import "TestPlaylist.h" +#import "TrackerSingletonSetup.h" @import libextobjc; @import SRGDataProviderNetwork; @@ -28,6 +29,11 @@ @implementation PlaylistsTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.dataProvider = [[SRGDataProvider alloc] initWithServiceURL:SRGIntegrationLayerProductionServiceURL()]; diff --git a/Tests/SRGLetterboxTests/RateTestCase.m b/Tests/SRGLetterboxTests/RateTestCase.m index 43a0bd08..81cbe2b3 100644 --- a/Tests/SRGLetterboxTests/RateTestCase.m +++ b/Tests/SRGLetterboxTests/RateTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import libextobjc; @import SRGLetterbox; @@ -19,6 +20,11 @@ @implementation RateTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/SkipTestCase.m b/Tests/SRGLetterboxTests/SkipTestCase.m index 352498b5..6096029b 100644 --- a/Tests/SRGLetterboxTests/SkipTestCase.m +++ b/Tests/SRGLetterboxTests/SkipTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import SRGLetterbox; @@ -18,6 +19,11 @@ @implementation SkipTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/SocialCountTestCase.m b/Tests/SRGLetterboxTests/SocialCountTestCase.m index c3bd766a..b2194d0e 100644 --- a/Tests/SRGLetterboxTests/SocialCountTestCase.m +++ b/Tests/SRGLetterboxTests/SocialCountTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import SRGLetterbox; @@ -21,6 +22,11 @@ @implementation SocialCountTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/SourceUidTestCase.m b/Tests/SRGLetterboxTests/SourceUidTestCase.m index 13894444..65c1ebcb 100644 --- a/Tests/SRGLetterboxTests/SourceUidTestCase.m +++ b/Tests/SRGLetterboxTests/SourceUidTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import SRGLetterbox; @@ -24,6 +25,11 @@ @implementation SourceUidTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/SwissTXTTestCase.m b/Tests/SRGLetterboxTests/SwissTXTTestCase.m index 8297447f..7212fcd6 100644 --- a/Tests/SRGLetterboxTests/SwissTXTTestCase.m +++ b/Tests/SRGLetterboxTests/SwissTXTTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import libextobjc; @import SRGLetterbox; @@ -22,6 +23,11 @@ @implementation SwissTXTTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/SwitchTestCase.m b/Tests/SRGLetterboxTests/SwitchTestCase.m index 1eace9ff..8026f527 100644 --- a/Tests/SRGLetterboxTests/SwitchTestCase.m +++ b/Tests/SRGLetterboxTests/SwitchTestCase.m @@ -5,6 +5,7 @@ // #import "LetterboxBaseTestCase.h" +#import "TrackerSingletonSetup.h" @import SRGDataProviderNetwork; @import SRGLetterbox; @@ -19,6 +20,11 @@ @implementation SwitchTestCase #pragma mark Setup and tear down ++ (void)setUp +{ + SetupTestSingletonTracker(); +} + - (void)setUp { self.controller = [[SRGLetterboxController alloc] init]; diff --git a/Tests/SRGLetterboxTests/TrackerSingletonSetup.h b/Tests/SRGLetterboxTests/TrackerSingletonSetup.h new file mode 100644 index 00000000..a8264b75 --- /dev/null +++ b/Tests/SRGLetterboxTests/TrackerSingletonSetup.h @@ -0,0 +1,13 @@ +// +// Copyright (c) SRG SSR. All rights reserved. +// +// License information is available from the LICENSE file. +// + +@import Foundation; + +NS_ASSUME_NONNULL_BEGIN + +OBJC_EXPORT void SetupTestSingletonTracker(void); + +NS_ASSUME_NONNULL_END diff --git a/Tests/SRGLetterboxTests/TrackerSingletonSetup.m b/Tests/SRGLetterboxTests/TrackerSingletonSetup.m index ba996a94..fb90683a 100644 --- a/Tests/SRGLetterboxTests/TrackerSingletonSetup.m +++ b/Tests/SRGLetterboxTests/TrackerSingletonSetup.m @@ -6,11 +6,11 @@ @import SRGAnalytics; -// The singleton can be only setup once. Do not perform in a test case setup -__attribute__((constructor)) static void SetupTestSingletonTracker(void) +void SetupTestSingletonTracker(void) { - SRGAnalyticsConfiguration *configuration = [[SRGAnalyticsConfiguration alloc] initWithBusinessUnitIdentifier:SRGAnalyticsBusinessUnitIdentifierRTS - container:7 - siteName:@"rts-app-test-v"]; + SRGAnalyticsConfiguration *configuration = [[SRGAnalyticsConfiguration alloc] initWithBusinessUnitIdentifier:SRGAnalyticsBusinessUnitIdentifierSRG + sourceKey:@"39ae8f94-595c-4ca4-81f7-fb7748bd3f04" + siteName:@"srg-test-letterbox-apple"]; + configuration.unitTesting = YES; [SRGAnalyticsTracker.sharedTracker startWithConfiguration:configuration]; } diff --git a/docs/FEATURES.md b/docs/FEATURES.md index 127134ae..56659fcc 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -41,6 +41,6 @@ The SRG Letterbox library provides an advanced player with several features: * Thumbnail retrieval and display. * Error display. * Recovery after network loss. -* Anonymous stream tracking conforming to internal (TagCommander / Webtrekk) and legal (Mediapulse) specifications. +* Anonymous stream tracking conforming to internal (Commanders Act / Webtrekk) and legal (Mediapulse) specifications. From a7b33afcf78874d1239431e6818ab2a080e073b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Sep 2023 16:55:41 +0200 Subject: [PATCH 06/11] Bump version number --- Demo/Xcode/Shared/Targets/Application.xcconfig | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Demo/Xcode/Shared/Targets/Application.xcconfig b/Demo/Xcode/Shared/Targets/Application.xcconfig index 04442cb4..eadbc1bb 100644 --- a/Demo/Xcode/Shared/Targets/Application.xcconfig +++ b/Demo/Xcode/Shared/Targets/Application.xcconfig @@ -1,8 +1,8 @@ #include "Xcode/Shared/Common.xcconfig" // Version information -MARKETING_VERSION = 9.1.2 -CURRENT_PROJECT_VERSION = 107 +MARKETING_VERSION = 9.2.0 +CURRENT_PROJECT_VERSION = 108 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index 8f8f4b96..cce06151 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion = "9.1.1" + static let marketingVersion = "9.2.0" } let package = Package( From d29eb6f459e29a3a58b696dd479400b3db256fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Sep 2023 16:57:03 +0200 Subject: [PATCH 07/11] Update what's new --- WhatsNew-demo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WhatsNew-demo.json b/WhatsNew-demo.json index dfa2ecfe..f153949b 100644 --- a/WhatsNew-demo.json +++ b/WhatsNew-demo.json @@ -71,5 +71,6 @@ "9.0.0-104": "- Remove bit rate setting in the library.", "9.1.0-105": "- Update image provider. Updated artwork in control center.\n- Fix some crashes with UI controls and the slider.", "9.1.1-106": "- Maintenance release for the library.", - "9.1.2-107": "- Fix slider layout issues on iOS 17." + "9.1.2-107": "- Fix slider layout issues on iOS 17.", + "9.2.0-108": "- Support for Commanders Act version 5\n- Allow capturing the player in screenshots and screen recordings." } From 17af1c4489ad7c3f1f8299c94117aaf749e655c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Sep 2023 17:03:33 +0200 Subject: [PATCH 08/11] Bump version number --- Demo/Xcode/Shared/Targets/Application.xcconfig | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Demo/Xcode/Shared/Targets/Application.xcconfig b/Demo/Xcode/Shared/Targets/Application.xcconfig index eadbc1bb..1afe0898 100644 --- a/Demo/Xcode/Shared/Targets/Application.xcconfig +++ b/Demo/Xcode/Shared/Targets/Application.xcconfig @@ -1,8 +1,8 @@ #include "Xcode/Shared/Common.xcconfig" // Version information -MARKETING_VERSION = 9.2.0 -CURRENT_PROJECT_VERSION = 108 +MARKETING_VERSION = 9.2.1 +CURRENT_PROJECT_VERSION = 109 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index cce06151..f467e58a 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion = "9.2.0" + static let marketingVersion = "9.2.1" } let package = Package( From eea48ae7129c92be055eb5534ade33e75b1c9288 Mon Sep 17 00:00:00 2001 From: Walid Kayhal <3347810+waliid@users.noreply.github.com> Date: Thu, 28 Sep 2023 06:19:03 +0200 Subject: [PATCH 09/11] Enhancement skip gestures handling and button Interactions (#310) --- Sources/SRGLetterbox/SRGControlsView.h | 5 ----- Sources/SRGLetterbox/SRGControlsView~ios.m | 19 ++++++---------- Sources/SRGLetterbox/SRGLetterboxView~ios.m | 25 ++++++++++++++++----- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Sources/SRGLetterbox/SRGControlsView.h b/Sources/SRGLetterbox/SRGControlsView.h index 4e873746..c89f2b94 100644 --- a/Sources/SRGLetterbox/SRGControlsView.h +++ b/Sources/SRGLetterbox/SRGControlsView.h @@ -91,11 +91,6 @@ API_UNAVAILABLE(tvos) */ @property (nonatomic) UIUserInterfaceStyle userInterfaceStyle; -/** - * The radius in which forward and backward skip controls are located. - */ -@property (nonatomic, readonly) CGFloat skipControlsRadius; - /** * The time corresponding to the current slider position. * diff --git a/Sources/SRGLetterbox/SRGControlsView~ios.m b/Sources/SRGLetterbox/SRGControlsView~ios.m index f756e8a1..8b702655 100644 --- a/Sources/SRGLetterbox/SRGControlsView~ios.m +++ b/Sources/SRGLetterbox/SRGControlsView~ios.m @@ -260,9 +260,9 @@ - (void)layoutCenterControlsInView:(UIView *)view { [self layoutPlaybackButtonInView:view]; [self layoutBackwardSkipButtonInView:view]; + [self layoutSkipToLiveButtonInView:view]; [self layoutForwardSkipButtonInView:view]; [self layoutStartOverButtonInView:view]; - [self layoutSkipToLiveButtonInView:view]; } - (void)layoutPlaybackButtonInView:(UIView *)view @@ -390,11 +390,6 @@ - (SRGImageSet)imageSet return (CGRectGetWidth(self.bottomStackView.frame) < 668.f || CGRectGetHeight(self.parentLetterboxView.frame) < 376.f) ? SRGImageSetNormal : SRGImageSetLarge; } -- (CGFloat)skipControlsRadius -{ - return self.imageSet == SRGImageSetLarge ? kDistanceToCenterLargeUnit + kLargeIconDimension / 2.f : kDistanceToCenterNormalUnit + kNormalIconDimension / 2.f; -} - #pragma mark Overrides - (void)willMoveToWindow:(UIWindow *)newWindow @@ -580,20 +575,20 @@ - (void)immediatelyUpdateLayoutForUserInterfaceHidden:(BOOL)userInterfaceHidden switch (transientState) { case SRGLetterboxViewTransientStateNone: { - [self.backwardSkipButton setTitle:[NSString stringWithFormat:@"%@S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; - [self.forwardSkipButton setTitle:[NSString stringWithFormat:@"%@S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; + [self.backwardSkipButton setTitle:[NSString stringWithFormat:@"%@ S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; + [self.forwardSkipButton setTitle:[NSString stringWithFormat:@"%@ S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; break; } case SRGLetterboxViewTransientStateDoubleTapSkippingBackward: { - [self.backwardSkipButton setTitle:[NSString stringWithFormat:@"-%@S", @(self.parentLetterboxView.doubleTapSkipCount * SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; - [self.forwardSkipButton setTitle:[NSString stringWithFormat:@"%@S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; + [self.backwardSkipButton setTitle:[NSString stringWithFormat:@"-%@ S", @(self.parentLetterboxView.doubleTapSkipCount * SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; + [self.forwardSkipButton setTitle:[NSString stringWithFormat:@"%@ S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; break; } case SRGLetterboxViewTransientStateDoubleTapSkippingForward: { - [self.backwardSkipButton setTitle:[NSString stringWithFormat:@"%@S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; - [self.forwardSkipButton setTitle:[NSString stringWithFormat:@"+%@S", @(self.parentLetterboxView.doubleTapSkipCount * SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; + [self.backwardSkipButton setTitle:[NSString stringWithFormat:@"%@ S", @(SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; + [self.forwardSkipButton setTitle:[NSString stringWithFormat:@"+%@ S", @(self.parentLetterboxView.doubleTapSkipCount * SRGLetterboxSkipInterval)] forState:UIControlStateNormal]; break; } } diff --git a/Sources/SRGLetterbox/SRGLetterboxView~ios.m b/Sources/SRGLetterbox/SRGLetterboxView~ios.m index 4ae3a948..5795c6f2 100644 --- a/Sources/SRGLetterbox/SRGLetterboxView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxView~ios.m @@ -1003,18 +1003,33 @@ - (void)handleSkip:(UIGestureRecognizer *)gestureRecognizer if (! self.userInterfaceTogglable && self.userInterfaceHidden) { return; } - - // Avoid conflicts between skip buttons and gestures in the center area - CGFloat skipControlsRadius = self.controlsView.skipControlsRadius; + CGPoint location = [gestureRecognizer locationInView:self]; - if (location.x < CGRectGetMidX(self.bounds) - skipControlsRadius) { + if ([self isLocationInsidePlayButton:location]) { + return; + } + + if (location.x < CGRectGetMidX(self.bounds)) { [self skipWithInterval:-SRGLetterboxSkipInterval]; } - else if (location.x > CGRectGetMidX(self.bounds) + skipControlsRadius) { + else if (location.x > CGRectGetMidX(self.bounds)) { [self skipWithInterval:SRGLetterboxSkipInterval]; } } +- (BOOL)isLocationInsidePlayButton:(CGPoint)location +{ + for (UIView *view in self.controlsView.subviews) { + for (UIView *subview in view.subviews) { + if ([subview isKindOfClass:SRGLetterboxPlaybackButton.class]) { + return CGRectContainsPoint(subview.frame, location); + } + } + } + + return NO; +} + - (void)skipWithInterval:(NSTimeInterval)interval { if (! [self.controller canSkipWithInterval:interval]) { From 5639b57a68e27a1af1ccd764fc0ee5b37b094f1d Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Fri, 6 Oct 2023 09:24:51 +0200 Subject: [PATCH 10/11] Modernize with Xcode 15 (#312) --- .../xcode/xcshareddata/xcschemes/SRGLetterbox.xcscheme | 2 +- Demo/SRGLetterbox-demo.xcodeproj/project.pbxproj | 9 +++++++-- .../xcshareddata/xcschemes/SRGLetterbox-demo.xcscheme | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/SRGLetterbox.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/SRGLetterbox.xcscheme index 92dde1d3..5e456d3a 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/SRGLetterbox.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/SRGLetterbox.xcscheme @@ -1,6 +1,6 @@ Date: Thu, 12 Oct 2023 19:31:02 +0200 Subject: [PATCH 11/11] Update what's new --- WhatsNew-demo.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WhatsNew-demo.json b/WhatsNew-demo.json index f153949b..7fd48319 100644 --- a/WhatsNew-demo.json +++ b/WhatsNew-demo.json @@ -71,6 +71,7 @@ "9.0.0-104": "- Remove bit rate setting in the library.", "9.1.0-105": "- Update image provider. Updated artwork in control center.\n- Fix some crashes with UI controls and the slider.", "9.1.1-106": "- Maintenance release for the library.", - "9.1.2-107": "- Fix slider layout issues on iOS 17.", - "9.2.0-108": "- Support for Commanders Act version 5\n- Allow capturing the player in screenshots and screen recordings." + "9.1.2-107": "- Fix slider layout issues on iOS 17.", + "9.2.0-108": "- Support for Commanders Act version 5\n- Allow capturing the player in screenshots and screen recordings.", + "9.2.1-109": "- Enhancement skip gestures handling and button Interactions\n- Modernize with Xcode 15." }