From d8164c2bc9ced34893771956f528b6aa00cdabf4 Mon Sep 17 00:00:00 2001 From: Stefan Painhapp <4242986+painhapp@users.noreply.github.com> Date: Thu, 17 Nov 2022 14:26:40 +0900 Subject: [PATCH] Fix Video Player Constraints issue --- Gemfile.lock | 2 ++ .../Video/MediaPreviewVideoViewController.swift | 7 ++++++- .../MastodonCore/Service/API/APIService+APIError.swift | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e0ed91c5b..15d02a8ec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,7 +100,9 @@ GEM PLATFORMS arm64-darwin-21 + arm64-darwin-22 x86_64-darwin-21 + x86_64-darwin-22 DEPENDENCIES arkana diff --git a/Mastodon/Scene/MediaPreview/Video/MediaPreviewVideoViewController.swift b/Mastodon/Scene/MediaPreview/Video/MediaPreviewVideoViewController.swift index 7bdbbfed2..cc559d8bb 100644 --- a/Mastodon/Scene/MediaPreview/Video/MediaPreviewVideoViewController.swift +++ b/Mastodon/Scene/MediaPreview/Video/MediaPreviewVideoViewController.swift @@ -45,7 +45,6 @@ extension MediaPreviewVideoViewController { playerViewController.view.widthAnchor.constraint(equalTo: view.widthAnchor), playerViewController.view.heightAnchor.constraint(equalTo: view.heightAnchor), ]) - playerViewController.didMove(toParent: self) if let contentOverlayView = playerViewController.contentOverlayView { previewImageView.translatesAutoresizingMaskIntoConstraints = false @@ -90,6 +89,12 @@ extension MediaPreviewVideoViewController { } } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + playerViewController.didMove(toParent: self) + } + } // MARK: - ShareActivityProvider diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+APIError.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+APIError.swift index 6fdb973da..52b6d4678 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+APIError.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+APIError.swift @@ -43,7 +43,7 @@ extension APIService.APIError: LocalizedError { public var errorDescription: String? { switch errorReason { - case .authenticationMissing: return "Fail to Authenticatie" + case .authenticationMissing: return "Fail to Authenticate" case .badRequest: return "Bad Request" case .badResponse: return "Bad Response" case .requestThrottle: return "Request Throttled"