Я пытаюсь понять, как работает AVPlayer & AVPlayerController. Я встроен в плеер, поэтому у меня есть два режима: маленький & весь экран. Когда маленькая кнопка play/plause и полноэкранная кнопка работают очень хорошо. Но как только он отображается в полноэкранном режиме, следующие кнопки не действуют: воспроизведение, пауза, выполнение, минимизация.AVPlayerController - Кнопки, которые не работают во весь экран
Вот мой код:
let videoURL = NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
let avPlayer:AVPLayer = AVPlayer(url: videoURL! as URL)
let playerController = AVPlayerViewController()
playerController.player = avPlayer
playerController.view.backgroundColor = UIColor.racingGreenColor();
playerController.view.translatesAutoresizingMaskIntoConstraints = false;
playerController.showsPlaybackControls = true;
self.middleView.addSubview(playerController.view)
//avPlayer.play()
self.middleView.addConstraint(NSLayoutConstraint(item: playerController.view, attribute: .width, relatedBy: .equal, toItem: self.middleView, attribute: .width, multiplier: 1, constant: 0));
self.middleView.addConstraint(NSLayoutConstraint(item: playerController.view, attribute: .height, relatedBy: .equal, toItem: self.middleView, attribute: .height, multiplier: 1, constant: 0));
self.middleView.addConstraint(NSLayoutConstraint(item: playerController.view, attribute: .centerX, relatedBy: .equal, toItem: self.middleView, attribute: .centerX, multiplier: 1, constant: 0));
self.middleView.addConstraint(NSLayoutConstraint(item: playerController.view, attribute: .centerY, relatedBy: .equal, toItem: self.middleView, attribute: .centerY, multiplier: 1, constant: 0));
Может кто-нибудь помочь мне, пожалуйста? Есть ли делегат для 4-х методов, которые меня интересуют?
Я не хочу его представлять, я хочу, чтобы он был встроен в представление ... –