1

我的 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

为什么不启用搜索栏?

4

2 回答 2

0

尝试:

[[player moviePlayer] setControlStyle:MPMovieControlModeDefault];
于 2013-03-01T18:11:37.480 回答
0

终于让它工作了。它是 php 中的“Content-range”标头,它丢失并导致搜索被禁用。

于 2013-03-01T20:51:30.690 回答