mpmovieplayercontroller

How to stop MPMoviePlayerViewController's automatic dismiss on moviePlaybackDidFinish?

感情迁移 提交于 2019-12-18 04:12:48
问题 An MPMoviePlayerViewController which is presented modally through presentMoviePlayerViewControllerAnimated: automatically dismisses itself when it's content finishes playing. I've tried to disable this, since I want to play other content afterwards. However, even if I register to the NSNotificationCenter with [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerVC.moviePlayer]; and set

How to insert header info into MPMoviePlayerController url?

笑着哭i 提交于 2019-12-18 03:46:54
问题 I need to implement video streaming service with http protocol. I know how to set url into MPMoviePlayerController, and how to set headerField into NSMutableURLRequest, but I have no idea how to combine them. I implement like below code, but not working, and I assume because there is no file info in the binary data. - (void) openUrl { NSMutableURLRequest *reqURL = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:@"http://111.222.33.44/MOV/2013/4/123123123"] cachePolicy

How to take a screenshot from an video playing through MPMediaPlayerController in iPhone?

非 Y 不嫁゛ 提交于 2019-12-18 03:43:43
问题 Can anybody help me in this? I want to get an screenshot from an video playing through MPMediaPlayerController. What i have tried so far is:- -(void)viewDidLoad { NSURL *tempFilePathURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"LMFao" ofType:@"mp4"]]; player = [[MPMoviePlayerController alloc] initWithContentURL:tempFilePathURL]; [player setControlStyle:MPMovieControlStyleFullscreen]; //Place it in subview, else it won’t work player.view.frame = CGRectMake(0, 0, 320,

How to play video from NSData

女生的网名这么多〃 提交于 2019-12-18 02:49:25
问题 I would like to know if it's possible to play a video from an NSData object... with the MPMoviePlayerController. 回答1: Ben's answer works perfectly on simulator but wont work on the device, You cannot write anywhere on the device. Check code below NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"myMove.mp4"]; [videoData

Possible to play video using a subclass of NSURLProtocol, using either MPMovieController or AVFoundation?

孤者浪人 提交于 2019-12-18 01:20:31
问题 I'm currently trying to play a video to a URL that has the custom scheme defined in a custom NSURLProtocol subclass. Initially I was using MPMoviePlayerController in an attempt to accomplish this, but after running into problems and checking stack overflow, I found that the MPMoviePlayerController does not handle NSURLProtocol subclasses as expected. How to play movie with a URL using a custom NSURLProtocol? As a result I decided to look at the AVFoundation framework, however, it seems that

AirPlay support, MPMoviePlayerController and MPVolumeView relation

只谈情不闲聊 提交于 2019-12-17 22:54:08
问题 I am developing an iPhone application that has support for video play. I am using MPMoviePlayerController with custom controls for playing the video. For this purpose I have set control style of MPMoviePlayerController to MPMovieControlStyleNone. I would like to support AirPlay feature for the video being played. As per the documentation, we have to set the 'allowsAirPlay' property of MPMoviePlayerController to YES to enable AirPlay feature. How can I display the AirPlay button on my player

MPMoviePlayerController's view does not recognize touch

你。 提交于 2019-12-17 22:32:13
问题 This is my code: _mediaPlayer = [[MPMoviePlayerController alloc] init]; _mediaPlayer.controlStyle = MPMovieControlStyleNone; _mediaPlayer.shouldAutoplay = NO; [_mediaPlayer.view setFrame: CGRectMake(5, 5, 600,400)]; [playerHolder addSubview: _mediaPlayer.view]; // [self prepareScreenContentToPlay]; // UITapGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleRollTap:)]; singleFingerTap.numberOfTapsRequired = 1; [_mediaPlayer.view

MPMoviePlayerViewController Generating lots of errors

落爺英雄遲暮 提交于 2019-12-17 19:31:11
问题 I am having issues to get MPMoviePlayerViewController to work. I have a new project that after viewDidLoad I try to play the movie in a moviePlayerViewController as below. I get the movie to play put I get lots and lots of error messages as below. Can someone explain what I am doing wrong to get these errors - (void)viewDidLoad { [super viewDidLoad]; [ self play ]; } - (void) play { NSURL *filmURL = [ NSURL URLWithString:@"http://www.ud-ltd.com/ipmt/Film16.mp4" ]; self.mvc = [

iOS MPMoviePlayerController playing audio in background

喜欢而已 提交于 2019-12-17 18:33:46
问题 I have MPMoviePlayerController that should play video's audio in background and should be controlled by the multitasking play/pause controls. After updating .plist file with Required background modes and calling the following: - (void)startBackgroundStreaming { [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; NSError *activationError = nil; AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory

Done button event MPMoviePlayerController

核能气质少年 提交于 2019-12-17 16:32:15
问题 On my iPhone i'm playing video/audio files in fullscreen mode. When the video/audio file reached its end then the following method is triggered: - (void) movieFinishedCallback:(NSNotification*) aNotification { MPMoviePlayerController *player = [aNotification object]; [player stop]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [player autorelease]; [moviePlayer.view removeFromSuperview]; NSLog(@"stopped?"); } That