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
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
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.
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()