0

I am using AVPlayerViewController for playing video.The problem is that how can I detect the video is started to play? Usually is to addTarget but I cannot find any Target that I can add on that event. Can someone help me? Thanks in advance.

Janice Zhan
  • 571
  • 1
  • 5
  • 18

1 Answers1

0

Use this callback method playerViewControllerDidStartPictureInPicture from apple documentation

eg

optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController){
     //Called when Picture in Picture playback has started.
}
Omer Malik
  • 409
  • 7
  • 15
  • Hmmm. I do not want to add pic in pic functions. What I want is to detect the event that when users click the play button – Janice Zhan Aug 27 '16 at 05:42