mpmovieplayercontroller

MPMoviePlayerController not working in iOS4

空扰寡人 提交于 2019-12-09 23:29:20
问题 I'm using the first answer from iOS 4 + MPMoviePlayerController to try and get MPMoviePlayerController to play. In the simulator (iPhone device with iOS4), I hear sound but no video. On the device (iPhone 3GS and iOS4), I don't get anything. Here's my code: MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; if ([moviePlayer respondsToSelector:@selector(view)])

iphone - MPMoviePlayerController - How can I decrease volume of the video programmatically

ぐ巨炮叔叔 提交于 2019-12-09 22:15:22
问题 I'm using MPMoviePlayerController to play a video which has audio as well. It's working fine. I'm hiding the default controls. So no controls are showing on the video. I want to place a slider on the video (I successfully placed a slider as well over the video). With the slider, I want to control the volume of the video that is being played. How can I control volume of video? 回答1: See the documentation for MPVolumeView. Here is a sample code that I use in my view controller. MPVolumeView

Check if URL-file exist or not

一曲冷凌霜 提交于 2019-12-09 21:47:57
问题 I wonder how I can check if a file exist on a server or not, without downloading the data first. I have around 30 different objects and some of them is connected to a movie on a server. At the moment I use NSData to control if the the URL exist, and then shows the movie, or if it doesn't and then alerts the user that there is no video for that object. The code I use for the moment: NSString *fPath = [[NSString alloc] initWithFormat:@"http://www.myserver/%@", [rows idNr]]; NSURL *videoURL =

Why can't I capture a screenshot of MPMoviePlayerController?

三世轮回 提交于 2019-12-09 19:03:03
问题 I need to capture a screen shot of a video playing in mpmovieplayer controller, but all I get is a red screen (I made the coverView with red background and 0.5 alpha). Here is the code: NSArray *windows = [[UIApplication sharedApplication] windows]; if ([windows count] > 1) { UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow]; UIView *coverView = [[UIView alloc] initWithFrame:moviePlayerWindow.bounds]; [mainController.moviePlayer pause]; //Without that it won't work

iOS - Video not rotating only in iOS7 over iPhone?

喜欢而已 提交于 2019-12-09 08:12:21
问题 What i have Done? I am playing videos in an extended class of MPMoviePlayerViewController and have implemented orientation functions as follows - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){ return FALSE; } else{ return TRUE; } } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [self

iPhone development mpmovieplayer crashing

╄→尐↘猪︶ㄣ 提交于 2019-12-09 05:23:00
问题 I am working on an app that will let me play different videos on the iPad remotely with an iPhone. I have been following along with apples example for a video player but I've been having some troubles. The videos play just fine and I can get it to play from a variety of videos but switching between them a few times it will crash and i get this in the debugger: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more

How to forward MPMoviePlayerController to specified time in iPhone application?

瘦欲@ 提交于 2019-12-08 21:08:41
问题 I am new to iPhone development, I need to play videos which are on some link and I have overlay of three labels(like 'jump to 1:20') on the MPMoviePlayerViewController by tapping on the label the movie controller is forwarded to that labeled time. I have tried two functions namely "setCurrentTime" and "initialPlaybackTime" but none of these didn't give result for me.. some help will be very helpful to me. thank you.. 回答1: @property(nonatomic) NSTimeInterval currentPlaybackTime It's part of

MPMoviePlayerController - Duration always 0

蓝咒 提交于 2019-12-08 16:57:09
问题 iPhone4, iOS 4.3.3, iOS SDK4.3 Hi all, I'm creating a video upload feature. The videos are retrieved using UIImagePickerController and can be captured using the camera or picked from the photo library. I have an application constraint of 60 seconds max duration. This is easily achieved when recording the video using the camera via: // Limit videos to 60 seconds [picker setVideoMaximumDuration:60]; However when the video is selected from the photo library the only way I see of obtaining the

MPMoviePlayerViewController playback video after going to background for youtube

非 Y 不嫁゛ 提交于 2019-12-08 14:19:28
I have set App Plays Audio for Required background modes in my app's info.plist to keep the mpmovieplayerviewcontroller not dismissing after going to background. It did a great job. However, Apple has rejected my app's update recently, as I set that attribute. Then I keep finding solutions for doing the same job but fail. To deal with it, I save the currentplaybacktime when the view controller receive UIApplicationDidEnterBackgroundNotification -(void)willEnterBackground { NSLog(@"willEnterBackground"); if (self.mp) { playbackTime = self.mp.moviePlayer.currentPlaybackTime; [self.mp

how to stop MPMoviePlayerViewController from downloading video if the app is in background

为君一笑 提交于 2019-12-08 12:32:34
问题 I use MPMoviePlayerViewController to play some videos form the internet. When the user presses home button and the app goes in background, the iphone still downloads a lot of information. Can anyone recomend me how the trafic can be stopped, without disabling multitasking or calling exit(0)? I have tried to stop the MPMoviePlayerViewController, but in some cases, when the MPMoviePlayerViewController is not fully loaded, the it doesn't respond(not the video, the MPMoviePlayerViewController).