MPMoviePlayerPlaybackDidFinishNotification gets called when it shouldn't

前端 未结 4 432
走了就别回头了
走了就别回头了 2021-02-06 13:19

According to Apple\'s MPMoviePlayerController doc:

MPMoviePlayerPlaybackDidFinishNotification - This notification is not sent in cases where the movie player is displayi

4条回答
  •  情深已故
    2021-02-06 14:09

    When you get the notification you can check the player's endPlaybackTime. If it's -1 then the movie finished all the way back naturally.

    For streamed content, you can check the MPMoviePlayerPlaybackDidFinishReasonUserInfoKey inside the userInfo on the MPMoviePlayerPlaybackDidFinishNotification.

    If it's equal to MPMovieFinishReasonUserExited then it's the user stopped playing the content.

提交回复
热议问题