【发布时间】:2015-06-17 05:51:03
【问题描述】:
我有一些视频文件准备好在我的服务器上进行流式传输。这是我尝试在 iOS 应用中播放它们的代码:
Video *vid = [videos objectAtIndex:index];
NSURL *vidUrl = [NSURL URLWithString:vid.videoUrl];
NSLog(@"%@",vid.videoUrl);
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:vidUrl];
player.controlStyle=MPMovieControlStyleEmbedded;
[player.view setFrame:self.view.bounds];
[self.view addSubview:player.view];
[player play];
如果我将 NSLog 吐出的 URL 复制并粘贴到 Safari 中,视频可以正常播放。所以我知道这个网址很好。但在我的应用程序中,我只是得到一个黑屏。我的代码有什么问题?
【问题讨论】:
标签: ios media-player mpmovieplayercontroller http-live-streaming