0

I am using AVPlayerViewController for live video streaming in my app.

I have a problem with video window size in landscape mode. The following code works fine for all iPad models and for iPhone 4s only. However, for iPhone 5 and later (iPhone 6, 6s etc.), the video is not fullscreen, i.e. it is not covering the entire screen in the landscape mode. The video does cover the full height of screen, but not full width of screen.

NSURL *videoURL = [NSURL URLWithString:channelURL];
player = [AVPlayer playerWithURL:videoURL];
playerController.player = player;
[self presentViewController:playerController animated:YES completion:nil];
[player play];

Thanks.

Muhsin Zahid Ugur
  • 533
  • 1
  • 5
  • 14

1 Answers1

0

Use following code snippet. Works fine in all devices.

NSURL *videoURL = [NSURL URLWithString:@"http://techslides.com/demos/sample-videos/small.mp4"];
MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
playerController.moviePlayer.shouldAutoplay = YES;
[self presentViewController:playerController animated:YES completion:nil];
Aruna Mudnoor
  • 4,795
  • 14
  • 16
  • Thanks for your answer. However, first, it does not help me, no change in my issue. Second, MPMoviePlayerViewController is deprecated so I don't want to use it. – Muhsin Zahid Ugur Jan 05 '16 at 06:49