I'm trying to code a video player in Objective-C using XCode & a guide, but I'm getting an error for some reason, and I'm quite new to Objective C, the exact error code is - Property 'frame' not found on object of type AVPlayer.
Viewcontroller.h
@property (nonatomic) IBOutlet AVPlayer *avPlayer;
@property (nonatomic, strong) NSMutableString *frame;
Viewcontroller.m
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"vid" ofType:@"mp4"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
self.avPlayer = [AVPlayer playerWithURL:fileURL];
AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:self.avPlayer];
self.avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
layer.frame = CGRectMake(0, 0, 1024, 768); //error point
[self.view.layer addSublayer: layer];
[self.avPlayer play];
}
I've been following this guide - http://jacopretorius.net/2013/02/playing-video-in-ios.html after trying multiple others.
My question is, why doesn't declaring the 'frame' work, I've also tried multiple ID's for the AVPlayer object & different ways to code the video player.
I've also tried -