ios - 飞行模式打开时无法在 iOS 7 中播放本地视频流

标签 ios objective-c ios7

我启动了一个本地 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....
  }
}

最佳答案

尝试使用 127.0.0.1 而不是本地主机。它对我有用

关于ios - 飞行模式打开时无法在 iOS 7 中播放本地视频流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19007518/

相关文章:

iphone - 用于右填充 NSString 的 objective-c 代码?

iphone - 在iPhone5S中使用M7芯片

ios - 在 ios 7 中添加显示窗体底部的栏

ios - 如何在 XCode 中使用 NSConnection 进行 JSON 延迟加载?

ios - 除了 Localizable.strings,如何在 Xcode 中创建多个 .strings 文件

ios - 自定义 UITableViewCell : UITextFields clearing when scrolled out of view- dequeuing problems 的问题

ios - 类型 'String' 不符合协议(protocol) 'NilLiteralConvertiblle'

iOS clocationmanager gmt 值

ios - UIImageView 在坐标系中的像素位置

iphone - Objective-C 将 NSData 转换为 NSString