Sagar S. Kadookkunnan
Sagar S. Kadookkunnan

Reputation: 673

How to get touch/click on a MPMoviePlayerController view when MPMovieControlStyle = MPMovieControlStyleNone

In one of my application, I don't want to show any video controllers. But I need to get the touch on the media player view. I need to do some other action on touch on the movie player. How can I implement that. Please help

Thanks in advance.

Upvotes: 4

Views: 6696

Answers (2)

Mohit Gaur
Mohit Gaur

Reputation: 69

You can also use this delegate method of UIGestureRecognizer.

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;

Upvotes: 0

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

You can always attach a UITapGestureRecognizer to the view and handle the taps.

UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
[moviePlayer.view addGestureRecognizer:tap];
[tap release];

And handle the tap in handleTap:

- (void)handleTap:(UITapGestureRecognizer *)gesture {
    // Do some other action as intended.
}

Of course this works only on iOS 3.2 and later.

Upvotes: 5

Related Questions