AVPlayer, notification for play/pause state?

后端 未结 5 844
离开以前
离开以前 2021-01-31 15:45

I\'m searching for a way to get notified the exact moment when AVPlayer starts playing. There\'s the \"rate\" property, but currently I am checking it periodically

5条回答
  •  青春惊慌失措
    2021-01-31 16:14

    For iOS 10 onwards You can check new property of AVPlayer timeControlStatus.

    if(avPlayerObject.timeControlStatus==AVPlayerTimeControlStatusPaused)
    {
    //Paused mode
    }
    else if(avPlayerObject.timeControlStatus==AVPlayerTimeControlStatusPlaying)
    {
     //Play mode
    }
    

提交回复
热议问题