From f849a204ffa7556b7a2e4c18094c3ea5d3ac83c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Jul 2022 09:17:42 +0200 Subject: [PATCH 1/6] Fix Letterbox view leak --- Sources/SRGLetterbox/SRGLetterboxView~ios.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SRGLetterbox/SRGLetterboxView~ios.m b/Sources/SRGLetterbox/SRGLetterboxView~ios.m index fd5b01ea..c1144ec2 100644 --- a/Sources/SRGLetterbox/SRGLetterboxView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxView~ios.m @@ -307,7 +307,6 @@ - (void)willMoveToWindow:(UIWindow *)newWindow @weakify(self) [self.controller addObserver:self keyPath:@keypath(SRGLetterboxController.new, mediaPlayerController.player.externalPlaybackActive) options:0 block:^(MAKVONotification *notification) { @strongify(self) - // Called e.g. when the route is changed from the control center [self showAirPlayNotificationMessageIfNeededAnimated:YES]; }]; @@ -591,7 +590,9 @@ - (BOOL)isLive - (void)registerObservers { SRGLetterboxController *controller = self.controller; + @weakify(self) [controller addObserver:self keyPath:@keypath(controller.loading) options:0 block:^(MAKVONotification *notification) { + @strongify(self) [self setNeedsLayoutAnimated:YES]; }]; @@ -628,7 +629,6 @@ - (void)registerObservers SRGMediaPlayerView *mediaPlayerView = mediaPlayerController.view; - @weakify(self) [mediaPlayerView addObserver:self keyPath:@keypath(mediaPlayerView.readyForDisplay) options:0 block:^(MAKVONotification *notification) { @strongify(self) [self setNeedsLayoutAnimated:YES]; From aba64e6cc4b321e5a4bb93d9c86e378c62285618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Jul 2022 09:18:59 +0200 Subject: [PATCH 2/6] Group related delegate methods --- Sources/SRGLetterbox/SRGLetterboxView~ios.m | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Sources/SRGLetterbox/SRGLetterboxView~ios.m b/Sources/SRGLetterbox/SRGLetterboxView~ios.m index c1144ec2..d73219a6 100644 --- a/Sources/SRGLetterbox/SRGLetterboxView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxView~ios.m @@ -1063,6 +1063,24 @@ - (void)toggleFullScreen:(id)sender #pragma mark SRGContinuousPlaybackViewDelegate protocol +- (void)continuousPlaybackView:(SRGContinuousPlaybackView *)continuousPlaybackView didEngageWithUpcomingMedia:(SRGMedia *)upcomingMedia +{ + [self setTogglableUserInterfaceHidden:YES animated:NO]; + + if ([self.delegate respondsToSelector:@selector(letterboxView:didEngageInContinuousPlaybackWithUpcomingMedia:)]) { + [self.delegate letterboxView:self didEngageInContinuousPlaybackWithUpcomingMedia:upcomingMedia]; + } +} + +- (void)continuousPlaybackView:(SRGContinuousPlaybackView *)continuousPlaybackView didCancelWithUpcomingMedia:(SRGMedia *)upcomingMedia +{ + if ([self.delegate respondsToSelector:@selector(letterboxView:didCancelContinuousPlaybackWithUpcomingMedia:)]) { + [self.delegate letterboxView:self didCancelContinuousPlaybackWithUpcomingMedia:upcomingMedia]; + } +} + +#pragma mark SRGControlsViewDelegate protocol + - (void)controlsView:(SRGControlsView *)controlsView didSelectPlaybackRate:(float)playbackRate { if ([self.delegate respondsToSelector:@selector(letterboxView:didSelectPlaybackRate:)]) { @@ -1084,24 +1102,6 @@ - (void)controlsView:(SRGControlsView *)controlsView didSelectSubtitleLanguageCo } } -- (void)continuousPlaybackView:(SRGContinuousPlaybackView *)continuousPlaybackView didEngageWithUpcomingMedia:(SRGMedia *)upcomingMedia -{ - [self setTogglableUserInterfaceHidden:YES animated:NO]; - - if ([self.delegate respondsToSelector:@selector(letterboxView:didEngageInContinuousPlaybackWithUpcomingMedia:)]) { - [self.delegate letterboxView:self didEngageInContinuousPlaybackWithUpcomingMedia:upcomingMedia]; - } -} - -- (void)continuousPlaybackView:(SRGContinuousPlaybackView *)continuousPlaybackView didCancelWithUpcomingMedia:(SRGMedia *)upcomingMedia -{ - if ([self.delegate respondsToSelector:@selector(letterboxView:didCancelContinuousPlaybackWithUpcomingMedia:)]) { - [self.delegate letterboxView:self didCancelContinuousPlaybackWithUpcomingMedia:upcomingMedia]; - } -} - -#pragma mark SRGControlsViewDelegate protocol - - (BOOL)controlsViewShouldHideFullScreenButton:(SRGControlsView *)controlsView { return [self isFullScreenButtonHidden]; From a46854614e2eff02f821ca4d6eb9727ace15ed4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 15 Jul 2022 15:09:23 +0200 Subject: [PATCH 3/6] Group actions --- Sources/SRGLetterbox/SRGLetterboxView~ios.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/SRGLetterbox/SRGLetterboxView~ios.m b/Sources/SRGLetterbox/SRGLetterboxView~ios.m index d73219a6..ad4beb88 100644 --- a/Sources/SRGLetterbox/SRGLetterboxView~ios.m +++ b/Sources/SRGLetterbox/SRGLetterboxView~ios.m @@ -174,14 +174,14 @@ - (void)layoutPlayerViewInView:(UIView *)view [self addGestureRecognizer:singleTapGestureRecognizer]; self.singleTapGestureRecognizer = singleTapGestureRecognizer; - SRGTapGestureRecognizer *doubleTapGestureRecognizer = [[SRGTapGestureRecognizer alloc] initWithTarget:self action:@selector(skipFromGestureRecognizer:)]; + SRGTapGestureRecognizer *doubleTapGestureRecognizer = [[SRGTapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSkip:)]; doubleTapGestureRecognizer.numberOfTapsRequired = 2; doubleTapGestureRecognizer.delaysTouchesEnded = NO; doubleTapGestureRecognizer.tapDelay = 0.25; [self addGestureRecognizer:doubleTapGestureRecognizer]; self.doubleTapGestureRecognizer = doubleTapGestureRecognizer; - UIPinchGestureRecognizer *videoGravityChangePinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)]; + UIPinchGestureRecognizer *videoGravityChangePinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handleVideoGravityPinch:)]; [self addGestureRecognizer:videoGravityChangePinchGestureRecognizer]; } @@ -960,7 +960,7 @@ - (void)handleSingleTap:(UITapGestureRecognizer *)gestureRecognizer switch (self.transientState) { case SRGLetterboxViewTransientStateDoubleTapSkippingBackward: case SRGLetterboxViewTransientStateDoubleTapSkippingForward: { - [self skipFromGestureRecognizer:gestureRecognizer]; + [self handleSkip:gestureRecognizer]; break; } @@ -971,7 +971,7 @@ - (void)handleSingleTap:(UITapGestureRecognizer *)gestureRecognizer } } -- (void)skipFromGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer +- (void)handleSkip:(UIGestureRecognizer *)gestureRecognizer { if (! self.userInterfaceTogglable && self.userInterfaceHidden) { return; @@ -1031,7 +1031,9 @@ - (void)resetTransientState self.doubleTapSkipCount = 0; } -- (void)handlePinch:(UIPinchGestureRecognizer *)gestureRecognizer +#pragma mark Actions + +- (void)handleVideoGravityPinch:(UIPinchGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { BOOL isZooming = (gestureRecognizer.scale > 1.f); @@ -1054,8 +1056,6 @@ - (void)handlePinch:(UIPinchGestureRecognizer *)gestureRecognizer } } -#pragma mark Actions - - (void)toggleFullScreen:(id)sender { [self setFullScreen:! self.isFullScreen animated:YES]; From a9d701a03b41c91e70e8f71a2cb24599e601be1c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Fri, 8 Jul 2022 14:13:35 +0200 Subject: [PATCH 4/6] 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 fc0e51f0..cb8fca49 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 = 8.2.0 -CURRENT_PROJECT_VERSION = 96 +MARKETING_VERSION = 8.2.1 +CURRENT_PROJECT_VERSION = 97 // Deployment targets IPHONEOS_DEPLOYMENT_TARGET = 12.0 diff --git a/Package.swift b/Package.swift index ae63bc6a..9e512cd8 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription struct ProjectSettings { - static let marketingVersion: String = "8.2.0" + static let marketingVersion: String = "8.2.1" } let package = Package( From c650112ad35027b973e30cb32f2a40acad10863a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Mon, 18 Jul 2022 15:10:01 +0200 Subject: [PATCH 5/6] Update dependencies --- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- Package.resolved | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved index ecedd580..a6e6de79 100644 --- a/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/SRGLetterbox-demo.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -141,8 +141,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgmediaplayer-apple.git", "state": { "branch": null, - "revision": "d97e45370d747c10c03341754af3741fafb6bf9f", - "version": "7.0.2" + "revision": "00ed47f86ac872d420583967e07e12fcbebaf8dc", + "version": "7.0.3" } }, { diff --git a/Package.resolved b/Package.resolved index 5e84c18c..31dcc9c8 100644 --- a/Package.resolved +++ b/Package.resolved @@ -123,8 +123,8 @@ "repositoryURL": "https://github.com/SRGSSR/srgmediaplayer-apple.git", "state": { "branch": null, - "revision": "d97e45370d747c10c03341754af3741fafb6bf9f", - "version": "7.0.2" + "revision": "00ed47f86ac872d420583967e07e12fcbebaf8dc", + "version": "7.0.3" } }, { From 2d1840a7dafb465b4809da52a63f10e23966540a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Mon, 18 Jul 2022 15:10:12 +0200 Subject: [PATCH 6/6] Update demo 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 57ae0da5..408fd807 100644 --- a/WhatsNew-demo.json +++ b/WhatsNew-demo.json @@ -60,5 +60,6 @@ "8.0.0-93": "## Modern gestures (iOS only)\n\n- Skip mode is entered by double-tapping the player once. This gesture can be followed by additional single taps to move further in time.\n- Content gravity is now managed with a pinch gesture and also provides a way to enter or exit full screen mode (provided the dedicated button is also available).\n- The skip and pinch gestures can be performed whether user interface controls are visible or not.\n- The forward skip buttons now move 10 seconds forward instead of 30 seconds. Control center behavior has been updated accordingly.\n\n## Improvements\n\n- Times displayed by a Letterbox view during DVR livestream playback are now always formatted in the Zurich timezone.\n- Age rating blocking reason messages have been updated.", "8.0.0-94": "## Modern gestures (iOS only)\n\n- Skip mode is entered by double-tapping the player once. This gesture can be followed by additional single taps to move further in time.\n- Content gravity is now managed with a pinch gesture and also provides a way to enter or exit full screen mode (provided the dedicated button is also available).\n- The skip and pinch gestures can be performed whether user interface controls are visible or not.\n- The forward skip buttons now move 10 seconds forward instead of 30 seconds. Control center behavior has been updated accordingly.\n\n## Improvements\n\n- Times displayed by a Letterbox view during DVR livestream playback are now always formatted in the Zurich timezone.\n- Age rating blocking reason messages have been updated.", "8.1.0-95": "- This releases is a maintenance release without visible changes.", - "8.2.0-96": "- This demo application now supports 5 languages: Romansh, Italian, German, French and English.\n- Forced subtitles matching the currently selected audio language are automatically displayed.\n- Fix font weight on devices whose language is different from English." + "8.2.0-96": "- This demo application now supports 5 languages: Romansh, Italian, German, French and English.\n- Forced subtitles matching the currently selected audio language are automatically displayed.\n- Fix font weight on devices whose language is different from English.", + "8.2.1-97": "- This releases is a maintenance release without visible changes." } \ No newline at end of file