Вы имеете в виду только создание простого класса? Потому что это просто, просто создать новый класс и добавить AVLayer вместо создания AVPlayerViewController:
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"mp4"];
NSURL *videoURL = [NSURL fileURLWithPath:videoPath];
AVPlayerItem * playerItem = [AVPlayerItem playerItemWithURL:videoURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(itemDidFinishPlaying:) name:AVPlayerItemDidPlayToEndTimeNotification object:playerItem];
AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem];
AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player];
playerLayer.frame = self.view.bounds;
[self.view.layer addSublayer:playerLayer];
[player play];
Затем переопределить правильные методы:
- (BOOL)shouldAutorotate {
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;
}