mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 18:21:00 +00:00
Video Player: Pause video when onDisappear
This commit is contained in:
parent
27164fa399
commit
04b5804c96
1 changed files with 3 additions and 0 deletions
|
@ -68,6 +68,9 @@ struct VideoPlayerView: View {
|
|||
}.onAppear {
|
||||
viewModel.preparePlayer(autoPlay: preferences.autoPlayVideo)
|
||||
}
|
||||
.onDisappear {
|
||||
viewModel.pause()
|
||||
}
|
||||
.cornerRadius(4)
|
||||
.onChange(of: scenePhase, perform: { scenePhase in
|
||||
switch scenePhase {
|
||||
|
|
Loading…
Reference in a new issue