I can't seem to stop video, only pause, but that leads to the video starting where it was paused, instead of starting over again as I'd like it to on the next time a user plays the video.
VStack {
VideoPlayer(player: player)
.edgesIgnoringSafeArea(.all)
.onAppear {
player.play()
}
.onDisappear {
player.pause()
}
}
How am I able to stop the video on disappear, so that it resets each time it plays?
question from:
https://stackoverflow.com/questions/65909240/ios-swiftui-reset-videoplayer-to-beginning-of-video 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…