I have some audio and video files stored in a server. I need to play them, but I do not know the files stored in server supported by iphone to play,
How can I check whether the file is supported by IPhone before start playing, I am using MPMoviePlayerController to play the files.
Before playing them, its not possible to identify. Movie player will throw error when incorrect format of file is passed to it.
For that, first you have to observe for noticiation: MPMoviePlayerLoadStateDidChangeNotification
as following:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerLoadStateChanged:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
When you catch this notification, check for players load state. If its loadState is "MPMovieLoadStateUnknown", then you can say that some error occured while playing the movie/audio.