Created
March 16, 2022 14:29
-
-
Save RealEmmettS/22a4cb24790a67637a16c8f7a147a255 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func playVideo() { | |
guard let path = Bundle.main.path(forResource: "video", ofType:"m4v") else { | |
debugPrint("video.m4v not found") | |
return | |
} | |
let player = AVPlayer(url: URL(fileURLWithPath: path)) | |
let playerController = AVPlayerViewController() | |
playerController.player = player | |
present(playerController, animated: true) { | |
player.play() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment