I'm creating an application to scan barcodes and provide video information on the scanned product. I'm running into the problem where the MPMoviePlayerViewController ends up giving me a wh开发者_StackOverflow社区ite screen if a video url is not valid. It should just go back to the previous screen if no video is available. How do I handle this exception? I can't find any delegate methods etc..
Thanks in advance,
Lewion
You can register yourself for a few notifications for MPMoviePlayer
controller which is moviePlayer
property of MPMoviePlayerViewController
, these notifications should handle these error situations.
PlaybackDidFinish
or PreloadDidFinish
and couple of new ones with SDK 4.0+ , like StateChanged
... these come with userinfo
dicitonary object from which you can detect error(s).
精彩评论