Try this code, I think it will work for you, because it seems that your URL is not linked to its website.
// your filepath which is may be "http" type NSString *filePath = [self.video_Array objectAtIndex:index]; // http to NSURL using string filepath NSURL *url= [[NSURL alloc] initWithString:filePath]; AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init]; playerViewController.videoGravity = AVLayerVideoGravityResize; playerViewController.view.frame = self.view.bounds; playerViewController.showsPlaybackControls = NO; video=[AVPlayer playerWithURL:url]; playerViewController.player = _video; playerViewController.view.userInteractionEnabled = false; [video play]; [self.view addSubview:playerViewController.view];
source share