mpmovieplayercontroller

iOS4 MPMoviePlayerController Embedding

混江龙づ霸主 提交于 2019-12-06 06:42:32
问题 I am using MPMoviePlayerController currently to play a video inside IPhone and now I wish to play this video in a small area of the view (not the full screen). I think there is a frame way of doing it but I couldn't find the required tutorial somewhere. Have you been across any? That would be great. UPDATED I have reached to this point but still it doesn't show the player to play on screen. -(IBAction)startVideo { //start video here NSURL *path = [[NSURL alloc] initWithString:[self

Cocos2d: How to play a video in the background of a CCLayer

佐手、 提交于 2019-12-06 06:31:33
问题 I want the video play in the background, and the text label in the front, run the following code, video is playing, but text label does not show! -(id) init { if(!(self=[super init])) { return nil; } CGSize size = [[CCDirector sharedDirector] winSize]; // MP4 NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"m4v"]]; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [moviePlayer respondsToSelector:@selector(setFullscreen:animated:

MpMovieplayerController tap gesture recognizer doesn't trigger when in fullscreen

放肆的年华 提交于 2019-12-06 05:39:48
问题 I´m trying to use UITapGestureRecognizer in order to handle the taps on my fullscreen video. If I omit [self.player setFullscreen:YES animated:NO]; it works, but then my video won't scale to fit the screen. From my .m: - (void)viewDidLoad { [super viewDidLoad]; NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mov"]; player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:videoPath]]; player.shouldAutoplay = NO; player.view.frame = self

Add MPMoviePlayerController's view to a UIView

你离开我真会死。 提交于 2019-12-06 04:27:56
问题 I want to add MPMoviePlayerController to a UIView . first, I put a view in xib file, named youTubeView. youtubePlayer is the MPMoviePlayerController . [youtubePlayer.view setFrame:youTubeView.frame]; [youTubeView addSubview:youtubePlayer.view]; [youtubePlayer play]; I want the view of youtubePlayer overlay on youTubeView. but the view of youtubePlayer goes wide, it just overlay a part of youTubeView. why ? 回答1: Try this [youtubePlayer.view setFrame:youTubeView.bounds]; [youTubeView addSubview

MPMoviePlayerController changing video speed

青春壹個敷衍的年華 提交于 2019-12-06 03:57:15
问题 Is there a way to play video at double speed using MPMoviePlayerController? myMPMoviePlayerController.currentPlaybackRate = 2.f doesn't change anything. 回答1: Play the movie first, then set the playback rate. 回答2: You have to use the setCurrentPlaybackRate method, like this: [myMPMoviePlayerController setCurrentPlaybackRate:2.f]; 回答3: Even it's bit old question now but I would like to share if someone having same problem. Here is the code sample I am using and its working with me -(void

Play Youtube video in MPMoviePlayerController or play RTSP - 3GP link

天涯浪子 提交于 2019-12-06 01:41:44
问题 I've checked on stackoverflow and searched all over the internet but haven't been able to find a solution to my problem. In my app I need to have control over the way a youtube video is shown. I need to have control over the MPMoviePlayerController and thereby MPMediaPlayback properties. So actually I have 3 questions: Is there already a solution for playing youtube videos directly in a MPMoviePlayerController that you create yourself? Is it somehow possible to play the RTSP - 3GP links

How to play audio through built-in earpiece speaker

霸气de小男生 提交于 2019-12-05 23:52:27
I have seen some apps like WhatsApp has a feature to play audio clips only through earpiece(phone call speaker) when the user brings up the device near to ear. Otherwise its playing via normal built-in speaker. I am using MPMoviePlayer for playing audio clips. I did go through lots of similar questions and answers on the internet, and all the answers say to set the AudioSession Category to PlayAndRecord. Thats it. I did the same, but couldn't get the exact result that I want to get. // Audio Player self.audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory

MPMoviePlayerController not showing controls until video is loaded

戏子无情 提交于 2019-12-05 21:56:19
I've an application based on iOS4, with a: MPMoviePlayerController and this settings: moviePlayerController.movieSourceType = MPMovieSourceTypeStreaming; moviePlayerController.controlStyle = MPMovieControlStyleDefault; Everything is working good, except that, when I present the MPMoviePlayerController view, it doesn't display controls until the video is pre-loaded. I know in previous version of iOS (3.x), controls are displayed as soon as MPMoviePlayer is presented. Any chance to have this working in ioS4? You have to use MPMoviePlayerViewController instead of MPMoviePlayerController. I'm

Set ContentURL of MPMoviePlayerController twice

馋奶兔 提交于 2019-12-05 19:08:27
I create an embedded MPMoviePlayerController thusly inside my loadView method: self.moviePlayerController = [[[MPMoviePlayerController alloc] init] autorelease]; // add to view, setup moviePlayerController's view frame, etc And I can later load a movie the user chooses thusly: NSURL *fileUrl = ... self.moviePlayerController.contentURL = fileUrl; and everything works great. However, if I set the contentURL again: NSURL *fileUrl2 = ... self.moviePlayerController.contentURL = fileUrl2; This does not work, even if fileUrl2 == fileUrl1. When I change the contentURL, I get the following

MPMoviePlayerController play video starting from 30th sec (from mid of the video)

谁说我不能喝 提交于 2019-12-05 18:34:58
I am creating a simple media player using MPMoviePlayerController , here I want to play the videos from particular point like from 30th sec or 50th second onwards and also want to move the video player head to any particular point and start playing it from that point. I tried with initialPlaybackTime and MPMoviePlaybackStateSeekingForward but no luck. video is not from local, its from server. Please help me to do the same. Swastik MPMoviePlayerController *mp; mp.initialPlaybackTime = 84; mp.endPlaybackTime = 118; It will start movie playback from 84th second till the 118th second. 来源: https:/