mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-10 21:54:10 +01:00
Fix memory leak related to video #1925
This commit is contained in:
parent
1299202bba
commit
9cf16b2f30
@ -50,6 +50,12 @@ import Models
|
||||
isPlaying = false
|
||||
player?.pause()
|
||||
}
|
||||
|
||||
func stop() {
|
||||
isPlaying = false
|
||||
player?.pause()
|
||||
player = nil
|
||||
}
|
||||
|
||||
func play() {
|
||||
isPlaying = true
|
||||
@ -96,7 +102,7 @@ public struct MediaUIAttachmentVideoView: View {
|
||||
viewModel.mute(preferences.muteVideo)
|
||||
}
|
||||
.onDisappear {
|
||||
viewModel.pause()
|
||||
viewModel.stop()
|
||||
}
|
||||
.onTapGesture {
|
||||
if !preferences.autoPlayVideo && !viewModel.isPlaying {
|
||||
|
Loading…
Reference in New Issue
Block a user