Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MPMoviePlayerViewController在ios 10.2中不工作_Ios_Iphone_Media Player_Mpmovieplayercontroller_Avkit - Fatal编程技术网

MPMoviePlayerViewController在ios 10.2中不工作

MPMoviePlayerViewController在ios 10.2中不工作,ios,iphone,media-player,mpmovieplayercontroller,avkit,Ios,Iphone,Media Player,Mpmovieplayercontroller,Avkit,当我在ios 10.2上使用以下代码时 MPMoviePlayerViewController *c = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieLoadStateDidChange:) name:MPMoviePlayerLoadStateD

当我在ios 10.2上使用以下代码时

 MPMoviePlayerViewController *c = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieLoadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
   [self.navigationController presentMoviePlayerViewControllerAnimated:c];
    [c.moviePlayer play];
但当我执行这段代码时,它会自动停止

**mpmovieplayervewcontroller*c=[[mpmovieplayervewcontroller alloc]initWithContentURL:url]

请帮忙。
info.plist中是否有任何更改?

我还使用了belwo代码AVAsset asset=[AVAsset assetwithur:url];AVPlayerItem*item=[[AVPlayerItem alloc]initWithAsset:asset];AVPlayer=[[AVPlayer alloc]initWithPlayerItem:item];player.volume=5.0;AVPlayerLayer*层=[AVPlayerLayer playerLayerWithPlayer:player];layer.frame=self.view.layer.bounds;UIView*view=[[UIView alloc]initWithFrame:self.view.frame]//view.backgroundColor=[UIColor blackColor];[view.layer addSublayer:layer];[self.view addSubview:view];[玩家游戏];但这不是在播放视频