Reputation: 6014
I am currently implementing video functionality into an iPhone app that requires the user to be able to 'Select and Play' a video and 'Record and Play' a video using the AVFoundation API. Similar to that shown in the tutorial here.
No problems so far implementing the functionality, however I now need to change the buttons shown recording a video for example - thus creating a custom overlay. For example the record button needs to be altered.
Upvotes: 1
Views: 555
Reputation: 473
The way I have done this before is to disable the controls from MPMovePlayerController, then put a UIImageView with your controls over the top, then put a UIView with UITapGestureRecognizer on top of that to detect when your controls are pressed.
Disabling the controls:
[_videoPlayer setControlStyle:MPMovieControlStyleNone];
Gesture recognizer:
touchLayer = [[UIView alloc] initWithFrame:self.frame];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapVideoControlOverlay:)];
[tapRecognizer setNumberOfTapsRequired:1];
[touchLayer addGestureRecognizer:tapRecognizer];
Upvotes: 1