WIP
This commit is contained in:
@@ -31,6 +31,8 @@ struct VideoPlayerView: View {
|
||||
|
||||
VideoPlayer(player: avPlayer)
|
||||
.onAppear{
|
||||
_ = try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: .mixWithOthers)
|
||||
|
||||
avPlayer.play()
|
||||
}
|
||||
}
|
||||
@@ -38,8 +40,13 @@ struct VideoPlayerView: View {
|
||||
.onReceive(pub) { (output) in
|
||||
avPlayer.pause()
|
||||
avPlayer.seek(to: .zero)
|
||||
_ = try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: .mixWithOthers)
|
||||
|
||||
avPlayer.play()
|
||||
}
|
||||
.onChange(of: avPlayer, perform: { newValue in
|
||||
avPlayer.play()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user