I cannot work this out - it should be simple.
I have:
ShowAVPlayer method
AVPlayerItem *video = [[AVPlayerItem alloc] initWithURL:url];
AVQueuePlayer *queue = [[AVQueuePlayer alloc] initWithItems:@[video]];
video = [[AVPlayerItem alloc] initWithURL:url];
[queue insertItem:video afterItem:nil];
AVPlayer *player = [AVPlayer playerWithURL:url];
self.avmovieplayer = [AVPlayerViewController new];
I want to add a button to my overlay - but the button is not responding :
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn setTitle:@"Do stuff" forState:UIControlStateNormal];
btn.frame = CGRectMake(0, 330, 320, 40);
[btn addTarget:self action:@selector(DoSpeech:) forControlEvents:UIControlEventTouchUpInside];
[btn setUserInteractionEnabled:true];
[self.avmovieplayer.contentOverlayView addSubview:btn];
Here is my DoSpeech
which is never being called:
- (void) DoSpeech:(UIButton *)button {
//DoSpeech
}