mpmovieplayercontroller

How do I catch the MPMoviePlayer next button click event while in fullscreen mode on the iPad?

末鹿安然 提交于 2019-12-03 20:59:51
When the MPMoviePlayerViewController is in fullscreen mode on the iPad, it defaults to having its controls to have a previous and next button on the overlay there. In my project I need to capture the click for that overlay button and handle it accordingly. Since I'm not sure how to invoke a playlist just yet there is no next item and clicking on the button breaks the view once I exit fullscreen mode. Somehow it just doesn't know what to do and I get no errors. What I would like to know is if there a way to listen/catch that event from the fullscreen next and previous buttons? I have also tried

MPMoviePlayerController fullscreen movie inside a UIWebView

£可爱£侵袭症+ 提交于 2019-12-03 18:26:31
问题 I'm having a problem with the UIWebView and MPMoviePlayerController: My UIWebView have a movie inside the html (it's a local html file), I'm using html5 and a video tag for the video. The problem is: the user can set the video to play inline, directly on the html or he can tap the fullscreen button, but I need to know if the video is playing fullscreen. I've tried to use MPMoviePlayerDidEnterFullscreenNotification but with no success. Does anybody know how to get this notification from the

MPMoviePlayerController doesn't play from Documents folder

怎甘沉沦 提交于 2019-12-03 16:21:47
Desperated. Hello everybody! I am having some issues with MPMoviePlayerController. I've made it working with videos from NSBundle. But that's not what I need. I need to play it from Documents directory, because that is the place I store the recorded videos, wich URLs are stored in CoreData. but lets leave this aside, and simplify the code to its minimum needed. This code actually WORKS if using the contentURL, wich leads to NSBundle. After it, what I do to get to the docs place. What I do: NSURL *contentURL = [[NSBundle mainBundle] URLForResource:@"Oct_08_2012_10_00_51" withExtension:@"mp4"];

How to make MPMoviePlayerController ignore the mute switch

泄露秘密 提交于 2019-12-03 16:16:34
问题 I want to play a video using MPMoviePlayerController but I want it to ignore the mute switch, similar to the behavior of Youtube's video player. Any ideas? 回答1: Use the AVAudioSession category AVAudioSessionCategoryPlayback and your app will ignore the mute switch like the Youtube app. For example (inspired by Ken Pletzer in the comments): #import <AVFoundation/AVFoundation.h> // note: you also need to add AVfoundation.framework to your project's // list of linked frameworks NSError *error =

Generating thumbnail from video - ios7

∥☆過路亽.° 提交于 2019-12-03 15:35:58
I am using this for reference: Getting thumbnail from a video url or data in IPhone SDK The method is using the MPMoviePlayerController class instead of the AVFoundation, and I think I want to use that as well because the people said that MPMoviePlayer way is faster than the AVFoundation way. The problem is, the method used to create the thumbnails, [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame] is deprecated in iOS 7.0. By looking at the apple docs, the remaining supported ways to create thumbnails are by the methods (void)requestThumbnailImagesAtTimes:(NSArray

MPMoviePlayerController background audio issue in iOS5

旧城冷巷雨未停 提交于 2019-12-03 15:03:56
I have an App that does the pretty standard operation: It plays audio (streamed or in filesystem) when the app is in 1) Foreground mode, 2) Screen locked state 3)Background mode. This was working fine in all iOS prior to iOS5. I have been using MPMoviePlayerController (Because it can play streamed and local file system audio) I have the following setup: info.plist has Background Mode set to "Audio" I have Audiosession setup as shown at http://developer.apple.com/library/ios/#qa/qa1668/_index.html NSError *activationError = nil; AVAudioSession *mySession = [AVAudioSession sharedInstance];

Disable Audio (and interruption) with MPMoviePlayerController using Swift

久未见 提交于 2019-12-03 14:52:52
问题 At the moment, this is how I'm playing a video on the subview of my UIViewController: override func viewDidAppear(animated: Bool) { let filePath = NSBundle.mainBundle().pathForResource("musicvideo", ofType: "mp4") self.moviePlayerController.contentURL = NSURL.fileURLWithPath(filePath) self.moviePlayerController.play() self.moviePlayerController.repeatMode = .One self.moviePlayerController.view.frame = self.view.bounds self.moviePlayerController.scalingMode = .AspectFill self

MPMoviePlayerPlaybackDidFinishNotification gets called when it shouldn't

依然范特西╮ 提交于 2019-12-03 14:48:31
问题 According to Apple's MPMoviePlayerController doc: MPMoviePlayerPlaybackDidFinishNotification - This notification is not sent in cases where the movie player is displaying in fullscreen mode and the user taps the Done button. Seems to me this is dead wrong. Using the code below, playerPlaybackDidFinish gets called when I tap the done button. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object

itemFailedToPlayToEnd - MPMoviePlayerController - iOS7

冷暖自知 提交于 2019-12-03 10:45:41
Running into a weird issue while updating my app for iOS 7 . For iOS 6 , there is no problem and the videos are always loaded. However that is not the case here. I have a scrollview which displays playlistItems - and once you click on the playlistItem , a MPMoviePlayerController is created to show the playlist item (video). Here is the method that I believe is causing issues: - (void) play:(NSInteger)itemId withAutostart:(BOOL)autostart { // remember whether it is in fullscreen or not to restore for the next playlist item self.playerInFullscreen = self.player.isFullscreen; if (player != nil) {

iOS - Video not rotating only in iOS7 over iPhone?

喜欢而已 提交于 2019-12-03 10:34:07
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 setControlsPositions:toInterfaceOrientation]; } -(BOOL)shouldAutorotate { return YES; } What issue i am Facing? The