MPMoviePlayerViewController没有搜索栏

时间:2013-03-01 17:40:04

标签: ios objective-c cocoa-touch streaming

我的MPMoviePlayerViewController不启用搜索栏或快进按钮。它只显示 - : - ,就像流式传输时一样。我的代码如下所示:

MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://REMOVED/listen.php?id=%@&token=%@", curid, token]]];
[[player moviePlayer] setRepeatMode:MPMovieRepeatModeNone];
[[player moviePlayer] setAllowsAirPlay:true];
[[player moviePlayer] ];
[[player moviePlayer] setMovieSourceType:MPMovieSourceTypeStreaming];
[self presentMoviePlayerViewControllerAnimated:player];

,文件头如下所示:

Connection:keep-alive
Content-Length:4012742
Content-Transfer-Encoding:binary
Content-Type:audio/mpeg
Date:Fri, 01 Mar 2013 17:28:57 GMT
Server:nginx admin
X-Powered-By:PHP/5.4.12

为什么不启用搜索栏?

2 个答案:

答案 0 :(得分:0)

尝试:

[[player moviePlayer] setControlStyle:MPMovieControlModeDefault];

答案 1 :(得分:0)

终于搞定了。 这是php中的“内容范围”标题,它丢失了并导致搜索被禁用。