-1

I have play video using AVPlayervewcontroller ,but I am facing issue to pause video. It has a method to stop video than start from beging, but I want to pause video.

Please give me some ideas how can I achieve this? Thanx

2 Answers2

0

An AVPlayerViewController has an AVPlayer (its player). Tell the player to pause, or set the player's rate to 0. This pauses the video without resetting its playhead position.

matt
  • 515,959
  • 87
  • 875
  • 1,141
0

AVplayerviewcontroller has audioPlayer property which access the the Player Object. To manage the playback, use the pause method. Read the full documentation here:- https://developer.apple.com/reference/avfoundation/avplayer/1387895-pause

Code example for reference:-

  audioPlayer.pause()
pkc456
  • 8,350
  • 38
  • 53
  • 109