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