I am trying to play movies from a view controller. I am using the code below to do that:
VideoPlayerViewController* moviePlayer = [self.storyboard instantiateViewControllerWithIdentifier:@"videoPlayerController"];
moviePlayer.view.frame = rect;
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];
[window.rootViewController presentViewController:moviePlayer animated:NO completion:nil];
[moviePlayer playMoviesForItems:items];
Normally it works fine. But sometimes, movie starts but I cannot see the video, just I can hear the sounds.
What is the best way to play video on top of everything?