How to detect AVPlayer actually started to play in swift

后端 未结 7 1480
情话喂你
情话喂你 2020-12-16 10:59

Hello I have set my UISliderminimum value to 0.00. Then I set it\'s max value in this way.

self.viewPlayer.layer.addSublayer(playerLayer)
    le         


        
7条回答
  •  情书的邮戳
    2020-12-16 11:28

    Another, simpler, approach is something like:

    if videoPlayer.rate != 0 && videoPlayer.error == nil {
                print("video player is playing.................")
            } else {
                print("video player is NOT playing.")
            } 
    

    Where videoPlayer is of type AVPlayer, obviously.

提交回复
热议问题