我启动了一个本地 http 服务器来提供视频流:
http://localhost:55736/videos/foo.m3u8
并MPMoviePlayerController
用来播放它。无论是否开启飞行模式,它在 iOS6 中都能正常运行。
但在 iOS 7 中,当飞行模式打开(或同时关闭 WIFI 和蜂窝数据网络)时,我得到了错误:
_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}
在MPMoviePlayerPlaybackDidFinishNotification
处理程序中:
NSConcreteNotification 0x146c35c0 {
name = MPMoviePlayerPlaybackDidFinishNotification;
object = <MPMoviePlayerController: 0x14682b90>;
userInfo = {
MPMoviePlayerPlaybackDidFinishReasonUserInfoKey = 1;
error = "Error Domain=MediaPlayerErrorDomain Code=-11800....
}
}