Merge pull request #9 from angristan/mute-default

Mute video player by default
This commit is contained in:
Thomas Ricouard 2022-12-31 06:40:29 +01:00 committed by GitHub
commit faa766d65f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ class VideoPlayerViewModel: ObservableObject {
func preparePlayer() { func preparePlayer() {
player = .init(url: url) player = .init(url: url)
player?.isMuted = true
player?.play() player?.play()
guard let player else { return } guard let player else { return }
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime,