mpmovieplayercontroller

MPMoviePlayerController gives me a black empty view,no video playing

廉价感情. 提交于 2019-12-23 07:36:43
问题 iOS 5.1 ,here is the code: MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL URLWithString:@"map.mp4"]]; [player prepareToPlay]; [player.view setFrame: self.view.bounds]; // player's frame must match parent's [self.view addSubview: player.view]; // ... [player play]; in fact ,this is just the same as the apple reference say,but when I click the button to use this function,there is just a black Rectangle stay there,no vedio playing ,no sound

MPMoviePlayerViewController, playing video's sound in background

余生长醉 提交于 2019-12-23 06:13:05
问题 I'm playing the video stream with MPMoviePlayerViewController . In my app's info.plist I have set UIBackgroundModes to audio . When I press home button while playing video playback is paused, after going back to application playback continues again. It works out of the box without having to change something. But in some applications (e.g. Jasmine) when I press Home button video's sound playing is continued in background. So I have 2 questions: 1) What's the magic? How to play video's sound in

MPMoviePlayerViewController, playing video's sound in background

独自空忆成欢 提交于 2019-12-23 06:12:50
问题 I'm playing the video stream with MPMoviePlayerViewController . In my app's info.plist I have set UIBackgroundModes to audio . When I press home button while playing video playback is paused, after going back to application playback continues again. It works out of the box without having to change something. But in some applications (e.g. Jasmine) when I press Home button video's sound playing is continued in background. So I have 2 questions: 1) What's the magic? How to play video's sound in

Streaming .m3u8 using MPMoviePlayerController does not work

南楼画角 提交于 2019-12-23 04:53:25
问题 I used the example in how to play a local video and tried to modify for use on .m3u8 file. I am unable to make it work. I get a blank screen. I confirmed that the file was ok by testing on VLC. Any help would be appreciated. Here is the code: import UIKit import MediaPlayer class ViewController: UIViewController { var moviePlayer : MPMoviePlayerController? override func viewDidLoad() { super.viewDidLoad() playVideo() // Do any additional setup after loading the view. } override func

MPMoviePlayerPlaybackDidFinishNotification not being called

独自空忆成欢 提交于 2019-12-23 04:07:09
问题 Here in my code playerPlayBackDidFinish is not called upon clicking the nextbutton and backButton on TopBar. but it is called when the video file is played completly, please help if anybody know... My code is as follows. #import "seq_nineViewController.h" @implementation seq_nineViewController @synthesize ninethVideoController, Bean; @synthesize localBackFlag; @synthesize goingNextButton, goingBackButton; - (void) viewWillAppear:(BOOL)animated { //[super viewWillAppear]; appDelegate =

MPMoviePlayerController do not play movie picked from UIImagePickerController

对着背影说爱祢 提交于 2019-12-23 03:18:06
问题 I have strange MPMoviePlayerController behavior. It don't want to play movies just chosen from UIImagePickerController's Camera Roll. But when I capture movie with UIImagePickerController - sometimes it plays in MPMoviePlayerController fine. This is UIImagePickerController initialization: mediaPickerController = [[[UIImagePickerController alloc] init] autorelease]; NSArray *types = [UIImagePickerController availableMediaTypesForSourceType:sourceType]; mediaPickerController.sourceType =

MPMoviePlayerController do not play movie picked from UIImagePickerController

青春壹個敷衍的年華 提交于 2019-12-23 03:18:06
问题 I have strange MPMoviePlayerController behavior. It don't want to play movies just chosen from UIImagePickerController's Camera Roll. But when I capture movie with UIImagePickerController - sometimes it plays in MPMoviePlayerController fine. This is UIImagePickerController initialization: mediaPickerController = [[[UIImagePickerController alloc] init] autorelease]; NSArray *types = [UIImagePickerController availableMediaTypesForSourceType:sourceType]; mediaPickerController.sourceType =

MPMoviePlayerViewController playback video after going to background for youtube

穿精又带淫゛_ 提交于 2019-12-23 03:14:54
问题 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(@

Airplay: Playing a Movie from MPMoviePlayerController results in only audio being streamed to Apple tv

眉间皱痕 提交于 2019-12-22 08:35:19
问题 Setting up Airplay was easy enough. self.moviePlayer = [[[MPMoviePlayerViewController alloc] initWithContentURL:url] autorelease]; [self.moviePlayer setAllowsAirPlay:YES]; However, when I try to play a video, only the audio is streamed. The video continues to play on the iPad. Additionally, the Airplay control only shows the "Audio Only" icon in the source list. (see photo). This makes me think that iOS "thinks" that only audio is playing. I have several other apps with Airplay on my device

iOS Determine Number of Frames in Video

倾然丶 夕夏残阳落幕 提交于 2019-12-22 08:34:05
问题 If I have a MPMoviePlayerController in Swift: MPMoviePlayerController mp = MPMoviePlayerController(contentURL: url) Is there a way I can get the number of frames within the video located at url ? If not, is there some other way to determine the frame count? 回答1: I don't think MPMoviePlayerController can help you. Use an AVAssetReader and count the number of CMSampleBuffer s it returns to you. You can configure it to not even decode the frames, effectively parsing the file, so it should be