The server is not correctly configured (-12939)

2019-07-15 11:51发布

Trying to play MP3 from server without first downloading the file locally. Callback for MPMoviePlayerPlaybackDidFinishNotification comes with this:

NSConcreteNotification 0x7e1c980 {name = MPMoviePlayerPlaybackDidFinishNotification; object = <ItemMediaPlayer: 0x7856740>; userInfo = {
    MPMoviePlayerPlaybackDidFinishReasonUserInfoKey = 1;
    error = "Error Domain=MediaPlayerErrorDomain Code=-12939 \"The server is not correctly configured.\" UserInfo=0x7e243d0 {NSLocalizedDescription=The server is not correctly configured.}";

Now trying to figure out what does error code -12939 actually mean... Does MPMoviePlayerController expect that server must support byte range requests? Because this server does not (using nginx)!

To complicate things, this code fails on iOS 4.0, but works on iOS 4.1. Now thinking about dropping iOS 4.0 support, unless someone can propose a fix?

1条回答
劫难
2楼-- · 2019-07-15 12:27

Have a look at AudioStream, which allows you play a MP3 from a URL by streaming it.

The error could do with the fact that your server does not support "Range Requests".

查看更多
登录 后发表回答