当前位置: 动力学知识库 > 问答 > 编程问答 >

Iphone MPMoviePlayerController "the server is not correctly configured"?

问题描述:

On the iphone, when trying to play a broken url using MPMoviePlayerController the user gets an alertbox with the message "the server is not correctly configured".

Is there any way to change this to something more user-friendly? Alternatively, is there any way to get an error status from the player instead of getting this message?

Thanks in advance..

网友答案:

MPMoviePlayer provides two notifications for the case of a broken / invalid movie URL:

From MPMoviePlayer initWithContentURL:

To check for errors in URL loading, register for the MPMoviePlayerContentPreloadDidFinishNotification or MPMoviePlayerPlaybackDidFinishNotification notifications.
On error, these notifications contain an NSError object available using the @"error" key in the notification’s userInfo dictionary.

You should be able to hook to one oh these notifications and perform the needed actions
if a broken URL is about to be loaded.

网友答案:

Once I've got this error when trying to play urlencoded url string. I removed urlencoding method call before ask MPMoviePlayerController to play url and everything ok.

网友答案:

Usually this error message means that the web server that's serving the file does not support HTTP byte ranges.

iPhone OS uses HTTP byte ranges for streaming audio and video content. This makes it possible to "scrub" forwards and backwards in the content without downloading the entire content first.

分享给朋友:
您可能感兴趣的文章:
随机阅读: