mirror of
https://github.com/lumaa-dev/BubbleApp.git
synced 2025-01-20 21:01:21 +01:00
Pause scrolled video
This commit is contained in:
parent
7c059fa652
commit
2ff6d93b69
@ -77,6 +77,10 @@ struct PostAttachment: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.onDisappear() {
|
||||
guard player != nil else { return }
|
||||
player?.pause()
|
||||
}
|
||||
|
||||
} else if attachment.supportedType == .video {
|
||||
ZStack {
|
||||
@ -101,6 +105,10 @@ struct PostAttachment: View {
|
||||
player?.play()
|
||||
}
|
||||
}
|
||||
.onDisappear() {
|
||||
guard player != nil else { return }
|
||||
player?.pause()
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: !isFeatured ? imageMaxHeight / 1.5 : newSize.width, height: !isFeatured ? imageMaxHeight: newSize.height)
|
||||
@ -144,7 +152,6 @@ class NoControlsAVPlayerViewController: AVPlayerViewController {
|
||||
}
|
||||
}
|
||||
|
||||
// Create a UIViewRepresentable for the customized AVPlayerViewController
|
||||
struct NoControlsPlayerViewController: UIViewControllerRepresentable {
|
||||
let player: AVPlayer
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user