mpmovieplayercontroller

MPMoviePlayerController - handle phone call

不羁岁月 提交于 2019-12-25 12:08:53
问题 I'm using MPMoviePlayerController to play a video. When a call comes, i want to pause and when he completes, i want to continue the video. I couldn't find relevant solution in my search. Is this something possible? Its possible to handle the interruptions using AVAudioSessionDelegate "beginInterruption" and "endInterruption". But when I am setting the session to play back, my movie player sound is not heard at all. Does any one know the solution? 回答1: There is a callEventHandler in Core

MPMoviePlayerViewController not showing volume slider?

喜欢而已 提交于 2019-12-25 05:10:08
问题 I am playing the video from the url: MPMoviePlayerViewController *m = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; if([m.moviePlayer respondsToSelector:@selector(setAllowsAirPlay:)]) m.moviePlayer.allowsAirPlay = YES; [self presentMoviePlayerViewControllerAnimated:m]; It is playing, but there is no volume control slider. Is it possible to add volume control? 回答1: You can use MPVolumeView object. volume = [[MPVolumeView alloc] initWithFrame: rect]; [self addSubview:volume]; 来源

How to rotate only the subclassed mpmovieplayer controller and keeping other views fixed to portrait

一笑奈何 提交于 2019-12-25 03:24:56
问题 I am using xcdYoutubeVideoViewController which is subclassed from MPMoviePlayerController. My application is in portrait. To launch the movieplayer, I am doing this: UINavigationController *navBarController = (UINavigationController*)[[[UIApplication sharedApplication] keyWindow] rootViewController] ; [navBarController presentMoviePlayerViewControllerAnimated:vc]; where vc is instance of XCDYouTubeVideoPlayerViewController. How can I allow rotation only in this view and on pressing done

is that UIWebView player a MPMoviePlayerController instance, and how to get a reference to that instance?

断了今生、忘了曾经 提交于 2019-12-25 03:22:25
问题 I need to play a youtube video in UIWebview and handle the event when user click the DOne button and when the video finish playing. I think of the solution that will handle the event that sent from UIWebview's media player. My question is: 1. is that the UIWebview's media player a MPMoviewPlayerController? 2. How do i refer to that instance and handle the event it sent out (such as: pause, stop, done, finish playing...) Thanks. 回答1: 1. is that the UIWebview's media player a

MPMoviePlayerViewController play from NSData (MP4)

爷,独闯天下 提交于 2019-12-25 00:21:38
问题 NSString *p = [app getFilePathFor:name]; // Printing description of p: // /Users/Jackson/Library/Application Support/iPhone Simulator/5.0/Applications/7FE97EDD-D080-4E5E-8EDD-3D9FFA8F6CF5/Documents/6681a4d7-8630-4a12-90c6-f95d72650a42 NSData *data = [NSData dataWithContentsOfFile:p]; // Printing description of data: // <01401dc2 a15ebc27 e473ee79 316568ff 19dc7000 df3f7c5c dc206870 01a1c00e 00010000 00000000 00e10288 00000003 01060020 08c80038 00080000 88edffbf 02000119 0000050e 00000000

MPMoviePlayerViewController not playing videos for IOS 8.4

倖福魔咒の 提交于 2019-12-24 17:53:07
问题 My videos are playing well for IOS 8.3 and earlier versions. But after a recent update of IOS 8.4 Video Player stopped working. Videos are not getting played and immediately it's going to MPMoviePlaybackComplete: method. Here is my code : self.player = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL]; [self.player.moviePlayer setFullscreen:YES animated:YES]; if(subtitlesPathStr){ [self.player.moviePlayer openSRTFileAtPath:subtitlesPathStr completion:^(BOOL finished) { //

MPMoviePlayerViewController not playing videos for IOS 8.4

折月煮酒 提交于 2019-12-24 17:53:00
问题 My videos are playing well for IOS 8.3 and earlier versions. But after a recent update of IOS 8.4 Video Player stopped working. Videos are not getting played and immediately it's going to MPMoviePlaybackComplete: method. Here is my code : self.player = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL]; [self.player.moviePlayer setFullscreen:YES animated:YES]; if(subtitlesPathStr){ [self.player.moviePlayer openSRTFileAtPath:subtitlesPathStr completion:^(BOOL finished) { //

How to play even background mode using MPMoviePlayerController

穿精又带淫゛_ 提交于 2019-12-24 16:12:41
问题 Audio Live Streaming Service using IIS7 is prepared. Audio Live streaming server setting is very complex, but have succeeded. I obtained a URL for streaming like this(@"http://xxx.xxx.xx.xx/liveStream.isml/manifest(format=m3u8-aapl).m3u8"). My using code is unexpectedly simple. self.theURL = [NSURL URLWithString:@"http://xxx.xxx.xx.xx/liveStream.isml/manifest(format=m3u8-aapl).m3u8"]; if(moviePlayer == nil) { moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theURL]; }

Check if video has audio or not

我的未来我决定 提交于 2019-12-24 13:59:02
问题 I have to make decision if a video file (streaming from server) has audio or not. If it has audio then I have to stop already playing audio file and start video else play video with already running audio. I have managed to pause audio before playing video but how can I check audio in a video? I am using AVAudioPlayer to play audio and MPMoviePlayerViewController to play video. I have searched a lot on google but no success. Any help will be appreciated. 回答1: http://developer.apple.com/library

MPMoviePlayerController - Exit, detect movie play and iAd

守給你的承諾、 提交于 2019-12-24 11:27:52
问题 I have successfully integrated a working movie player with a pre-roll iAd video! Thanks to @Daniel Storm. However, I want information on how to exit the movie when the movie is finished or when the ad is finished. (exit means remove from the view), Also detect if the user has watched the ad. If there is internet connection failure or iAd failure, how can i detect if the pre-roll ad did not play. I am making a game, and if a user decides to get more coins, that person must watch an ad. If they