Tag: mpmovieplayercontroller

repeatmode doesn't work in MPMoviePlayerViewController?

How to display a recorded video as repeat as an’n’ number of times like in Vine Application. Here I use the MPMoviePlayerViewController, and works great display the recorded video. But the problem is, it doesn’t repeating. Here the currently using code is, NSURL *url = [NSURL fileURLWithPath:videoPath]; playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; [self presentMoviePlayerViewControllerAnimated:playerController]; [playerController.moviePlayer […]

Keep playing sound with MPMoviePlayerController and locked screen?

When you’re watching a video with MPMoviePlayerController and the user presses the top button to lock the screen, the app goes to sleep and so does the sound from the video. Is there any way to prevent the lock from stopping the sound? If not, is there a way to intercept the lock, to create […]

Problem playing mov file in MPMoviePlayerController

(Im using this with Cocos2d) This works perfectly for an mp4 video NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@”intro_iphone” ofType:@”mp4″]]; mpc = [[MPMoviePlayerController alloc] initWithContentURL:url] [mpc setFullscreen:YES animated:NO]; mpc.shouldAutoplay = YES; mpc.view.backgroundColor = [UIColor whiteColor]; mpc.view.frame = CGRectMake(0.0f, 0.0f, screenSize.width, screenSize.height); [mpc setScalingMode:MPMovieScalingModeFill]; [mpc setControlStyle:MPMovieControlStyleNone]; [mpc setMovieSourceType:MPMovieSourceTypeFile]; [mpc setRepeatMode:MPMovieRepeatModeNone]; [[[CCDirector sharedDirector] openGLView] addSubview:mpc.view]; [mpc play]; […]

How to present MPMoviePlayerViewController from a UITabBarController?

I have a view controller that’s been added to a UITabBarController. In this view controller I have a button that opens up a movie using MPMoviePlayerViewController. When I play the movie, the top navigation bar is still overlayed on top of the movie, effectively blocking out a portion of the screen. When this view controller […]

How to enable iPhone auto lock during MPMoviePlayer playback?

When I play a video with MPMoviePlayerController in my app my iPhone does not auto lock (tested OS 3.0 & 3.1.2). However, the application.idleTimerDisabled = NO, so this setting is not affected by MPMoviePlayerController. How can I get my iPhone to sleep normally (e.g. after 3 min screen dims, then goes dark) when my app […]

MPMoviePlayer load and play movie saved in app documents

I am writing an application that stores the movies in the photo roll into the local documents folder for the app. I can play remote movies using the MPMoviePlayer, however trying to play a movie stored in the documents folder for the app always returns MPMovieLoadStateUnknown. The notifications are all getting sent and received from […]

How to resume a movie that's being played with presentMoviePlayerViewControllerAnimated

I’m uisng this code to display a movie: MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL]; mp.moviePlayer.movieSourceType = MPMovieSourceTypeUnknown; [self presentMoviePlayerViewControllerAnimated:mp]; [mp.moviePlayer play]; The code is working fine. However when the application goes to the background while playing a movie, when the app comes back in the foreground the movieplayer is not displayed. (I see the view […]

MPMoviePlayerController hide next prev buttons

is there an easy (maybe hacky) way to hide the next / prev buttons on apples MPMoviePlayerController? i dont want to change the skin, just “hide” the skip buttons. thanks Alex

Reverting to portrait after Done pressed on movie player?

I’ve got a MPMoviePlayer working. It is designed to show a postage-stamp size movie as a subview in the view. When the phone is rotated into landscape, it goes into full screen mode. And when the phone is in portrait it goes into postage-stamp portrait mode. The only problem is when I press Done when […]

iphone – force MPMoviePlayerController to play video in landscape mode

I have an app that is portrait mode only, but when the user plays a video I want it to play in fullscreen landscape mode (the video player doesn’t look good in portrait mode). I’m playing it like this: [self.view addSubview:myMoviePlayer.view]; [self.myMoviePlayer setFullscreen:YES animated:YES]; [self.myMoviePlayer play]; What’s the best way to accomplish this?