How to get an error description when playback fails on MPMoviePlayerController

前端 未结 3 1983
一整个雨季
一整个雨季 2020-12-10 05:01

I want to show an UIAlert if the Video-Play fails. So i registered the MPMoviePlayerPlaybackDidFinishNotification for my Movie Player:

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 05:32

    You can look at the value behind the userinfo dictionary's MPMoviePlayerPlaybackDidFinishReasonUserInfoKey. If the value is MPMovieFinishReasonPlaybackError, you can assume that some stuff went wrong. This method is pretty durn dependable.

提交回复
热议问题