【发布时间】:2018-07-04 07:29:56
【问题描述】:
如何通过时差获取此按钮事件/委托(播放、暂停、前进和后退)。
这里我把代码放在下面。请建议我们可以使用其他玩家参加此活动
player = AVPlayer(url:URL(fileURLWithPath: objpdfURL));
NotificationCenter.default.addObserver(self, selector: #selector(VedioPlayVC.didfinishplaying(note:)),name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: player.currentItem)
NotificationCenter.default.addObserver(self, selector:#selector(VedioPlayVC.Stop(note:)), name: .kAVPlayerViewControllerDismissingNotification, object: nil);
NotificationCenter.default.addObserver(self, selector: #selector(VedioPlayVC.Jump(note:)),name:NSNotification.Name.AVPlayerItemTimeJumped, object: nil)
playerController.player = player
playerController.allowsPictureInPicturePlayback = true
playerController.delegate = self
playerController.player?.play()
self.present(playerController,animated:true,completion:nil)
【问题讨论】:
标签: ios swift3 avplayer avplayerviewcontroller video-player