0

我正在开发一个带有来自服务器的功能流视频的 iOS 应用程序。我认为问题来自我的视频 url 它无法将视频加载到模拟器或 iOS 设备,但是当我在浏览器 PC 上访问时,该 url 工作正常。有人可以帮我解决这个问题吗?这是我的代码:

NSURL *videoURL = [NSURL    URLWithString:@"http://192.168.1.210:12345/WallPost/Download?filename=TheEmpressOfChinaOriginalSoundtrack1422348924923.mp4"];

     _moviePlayer = [[MPMoviePlayerViewController alloc] init];

     _moviePlayer.moviePlayer.contentURL = videoURL;

     _moviePlayer.view.frame = CGRectMake(10.0, 10.0, 300.0, 200.0);

     _moviePlayer.moviePlayer.movieSourceType = MPMovieSourceTypeFile;

     [_moviePlayer.moviePlayer setControlStyle:MPMovieControlStyleDefault];

     [self.view addSubview:_moviePlayer.view];

     [_moviePlayer.moviePlayer setAllowsAirPlay:YES];

     _moviePlayer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;

     [_moviePlayer.moviePlayer prepareToPlay];
4

0 回答 0