In 3.0, I could register for MPMoviePlayerContentPreloadDidFinishNotification
and detect if the movie preloaded or failed, depending on whether there was an error object. Can anyone tell me the equivalent of the two cases for iOS4?
[ Update : Responding to the first comment here because the max comment length is too short.]
If you successfully play a movie on iOS4, you get:
MPMoviePlayerContentPreloadDidFinishNotification
with no error object (deprecated) MPMoviePlayerLoadStateDidChangeNotification
and player.loadState=MPMovieLoadStatePlayable
MPMoviePlayerPlaybackDidFinishNotification
and player.loadState=MPMovieLoadStatePlaythroughOK
If it fails (for instance because of an incorrect URL), you get:
MPMoviePlayerPlaybackDidFinishNotification
loadState=MPMovieLoadStateUnknown
And that's it. No MPMoviePlayerContentPreloadDidFinishNotification
with an error object like in 3.0, no MPMoviePlayerLoadStateDidChangeNotification
. So is the only way to detect a failed load to inspect the player. loadState
for MPMovieLoadStateUnknown
in MPMoviePlayerPlaybackDidFinishNotification
?
It seems counterintuitive, to say the least.
Register for the MPMoviePlayerLoadStateDidChangeNotification
notification, and then check the loadState
property of the MPMoviePlayerController
.
Source: ADC Developer Documentation
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.