有谁知道这个解决方案?我可以听到视频但无法在模拟器中看到它。
func playinitiate() {
let locationVideo = NSURL(fileURLWithPath: Bundle.main.path(forResource: "Video", ofType: "mov")!)
let video = AVPlayer(url: locationVideo as URL)
let videoLayer = AVPlayerLayer(player: video)
videoLayer.frame = specialView.bounds
specialView.layer.addSublayer(videoLayer)
videoLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
video.play()
print("Player is running")