mirror of
https://github.com/lumaa-dev/BubbleApp.git
synced 2025-02-01 11:07:09 +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 {
|
} else if attachment.supportedType == .video {
|
||||||
ZStack {
|
ZStack {
|
||||||
@ -101,6 +105,10 @@ struct PostAttachment: View {
|
|||||||
player?.play()
|
player?.play()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onDisappear() {
|
||||||
|
guard player != nil else { return }
|
||||||
|
player?.pause()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: !isFeatured ? imageMaxHeight / 1.5 : newSize.width, height: !isFeatured ? imageMaxHeight: newSize.height)
|
.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 {
|
struct NoControlsPlayerViewController: UIViewControllerRepresentable {
|
||||||
let player: AVPlayer
|
let player: AVPlayer
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user