Problem playing mov file in MPMoviePlayerController

允我心安 提交于 2019-12-04 04:43:52

问题


(Im using this with Cocos2d)

This works perfectly for an mp4 video

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"intro_iphone" ofType:@"mp4"]];

mpc = [[MPMoviePlayerController alloc] initWithContentURL:url]
[mpc setFullscreen:YES animated:NO];
mpc.shouldAutoplay = YES;
mpc.view.backgroundColor = [UIColor whiteColor];
mpc.view.frame = CGRectMake(0.0f, 0.0f, screenSize.width, screenSize.height);

[mpc setScalingMode:MPMovieScalingModeFill];
[mpc setControlStyle:MPMovieControlStyleNone];
[mpc setMovieSourceType:MPMovieSourceTypeFile];
[mpc setRepeatMode:MPMovieRepeatModeNone];

[[[CCDirector sharedDirector] openGLView] addSubview:mpc.view];

[mpc play];

But if I try and change it to a .mov file, nothing happens!? There is no error, so its picking up the file, but theres no play back and no MPMoviePlayerPlaybackDidFinishNotification.


回答1:


Problem was the codec the .mov was created with, was not iPhone compatible.



来源:https://stackoverflow.com/questions/7493860/problem-playing-mov-file-in-mpmovieplayercontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!