Fix layout of downloaded looping media

This commit is contained in:
Pete Walters 2026-05-21 13:20:56 -05:00 committed by GitHub
parent a7eb78f46c
commit 4ab7d1d12d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,6 +120,7 @@ class MediaItemViewController: OWSViewController, VideoPlaybackStatusProvider {
playVideo()
hasAutoPlayedVideo = true
}
layoutMediaView()
}
}
@ -264,27 +265,7 @@ class MediaItemViewController: OWSViewController, VideoPlaybackStatusProvider {
return videoPlayerView
}
// MARK: - UIViewController
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .clear
configureMediaView()
view.addSubview(scrollView)
scrollView.autoPinEdgesToSuperviewEdges()
// Video Playback controls
if isVideo {
configureVideoPlaybackControls()
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
private func layoutMediaView() {
// HACK: Setting the frame to itself *seems* like it should be a no-op, but
// it ensures the content is drawn at the right frame. In particular I was
// reproducibly seeing some images squished (they were EXIF rotated, maybe
@ -342,6 +323,29 @@ class MediaItemViewController: OWSViewController, VideoPlaybackStatusProvider {
}
}
// MARK: - UIViewController
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .clear
configureMediaView()
view.addSubview(scrollView)
scrollView.autoPinEdgesToSuperviewEdges()
// Video Playback controls
if isVideo {
configureVideoPlaybackControls()
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
layoutMediaView()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)