0

我正在尝试使用以下代码播放 m3u8 实时流文件:

       NSURL *movieURL = [NSURL URLWithString:@"http://www.streaming507.com:1935/TVBlast/TVBlast/playlist.m3u8"];



    MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];

        [self.view addSubview:mp.view];

        [mp setFullscreen:YES animated:YES];
    mp.movieSourceType = MPMovieSourceTypeStreaming;

        [mp play];


}

当我在 safari 浏览器中的设备中复制/粘贴 streaming507.com:1935/TVBlast/TVBlast/playlist.m3u8 时,它播放完美并且效果很好我该如何解决这个问题?

我不知道我做错了什么

谢谢你

4

1 回答 1

0

我通过在我的 info.plist 中复制/粘贴来解决问题:

<key>NSAppTransportSecurity</key>
<dict>
  <!--Include to allow all connections (DANGER)-->
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>
于 2016-07-28T12:20:53.057 回答