Video Player: Pause video when onDisappear
This commit is contained in:
parent
27164fa399
commit
04b5804c96
|
@ -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 New Issue