npmrtsv
npmrtsv

Reputation: 434

How to show MPMoviePlayerController controls?

I have MPMoviePlayerController, and I want to show controls programmaticaly, like after user's tap, or simulate users tap.

https://i.sstatic.net/KYMmG.jpg (Sorry, I don't have enough reputation, to post images).

How can I do this? Thanks.

Upvotes: 3

Views: 8129

Answers (2)

Gonzo Oin
Gonzo Oin

Reputation: 379

Someone already answer to that question here i think

Set controlStyle property to MPMovieControlStyleNone initially, and then set it to MPMovieControlStyleFullscreen one second later using a [performSelector:withObject:afterDelay:1]. It works well, controls do not appear until user taps on video.

Upvotes: 1

Vimal Venugopalan
Vimal Venugopalan

Reputation: 4091

creating the MPMoviePlayerController object in the following way would give you an interface for video controls

yourMoviePlayerController = [MPMoviePlayerController new];     
yourMoviePlayerController.controlStyle=MPMovieControlStyleEmbedded;
[yourMoviePlayerController setContentURL:[NSURL fileURLWithPath:videoPath]];
yourMoviePlayerController.backgroundView.hidden = YES;

[yourMoviePlayerController setScalingMode:MPMovieScalingModeAspectFit];
yourMoviePlayerController.shouldAutoplay=YES;
yourMoviePlayerController.movieSourceType = MPMovieSourceTypeFile;

Upvotes: 6

Related Questions