开发者

UIVideoEditorController breaks MPMoviePlayerViewController?

开发者 https://www.devze.com 2023-02-18 23:53 出处:网络
In my app, I can use code like this to play a video: - (void)playVideo:(NSURL *)url { MPMoviePlayerViewController *m = [[[MPMoviePlayerViewCon开发者_如何学编程troller alloc] initWithContentURL:url] a

In my app, I can use code like this to play a video:

- (void)playVideo:(NSURL *)url {
    MPMoviePlayerViewController *m = [[[MPMoviePlayerViewCon开发者_如何学编程troller alloc] initWithContentURL:url] autorelease];
    [self.rootViewController presentMoviePlayerViewControllerAnimated:m];
}

And it works fine.

But if I use code like this to display a video editor:

- (void)editVideo:(NSString *)file {
    UIVideoEditorController *ed = [[[UIVideoEditorController alloc] init] autorelease];
    ed.delegate = self;
    ed.videoPath = file;
    [self.rootViewController presentModalViewController:ed animated:YES];
}

- (void)videoEditorControllerDidCancel:(UIVideoEditorController *)vc {
    [vc.parentViewController dismissModalViewControllerAnimated:YES];
}

and just hit cancel, the playVideo: method will no longer play a video! It brings up the movie player window fine and does the throbber to indicate loading, but once the load finishes it fails. Sometimes it closes the video window right away without playing anything, and sometimes it changes to a black screen that responds to no input (but will go away if I send the app to the background and then bring it back to the foreground). It's not MPMoviePlayerViewController Black Screen issue! though, as I get the same black screen if I intentionally leak the MPMoviePlayerViewController.

Am I doing something wrong, or is Apple's junk just broken?

0

精彩评论

暂无评论...
验证码 换一张
取 消