i) 搜索现场,但一吨 t发现的问题与地雷一样。
我在录像上播放时,要求通知“MPMoviePlayerPlaybackDidFinishNotification”。
之后,“单子” but子将录像带在pa中,参与者的作品坏......
我不理解为什么这一通知被称作......。
这是我的法典。
- (id) init
{
self = [super init];
movie=[[MPMoviePlayerViewController alloc] init];
//we init the frame here and after the view rotate the video
[movie.view setFrame: CGRectMake(0, 0, 1024,768)];
return self;
}
+ (MoviePlayerManager*) getInstance
{
static MoviePlayerManager *movieSingleton;
if (movieSingleton==nil)
{
movieSingleton = [[MoviePlayerManager alloc]init];
}
return movieSingleton;
}
- (void) load:(NSURL*) a_videoFile withType:(VideoType)a_type
{
type = a_type;
[movie.moviePlayer setContentURL:a_videoFile];
switch (type) {
case VT_INTRO:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallbackIntro:) name:MPMoviePlayerPlaybackDidFinishNotification object:movie.moviePlayer];
break;
case VT_RESPONSE:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallbackResponse:) name:MPMoviePlayerPlaybackDidFinishNotification object:movie.moviePlayer];
break;
default:
NSLog(@"video Type not initialised");
break;
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieIsReadyToPlay:) name:MPMediaPlaybackIsPreparedToPlayDidChangeNotification object:movie.moviePlayer];
[movie.moviePlayer prepareToPlay];
}
-(void)myMovieIsReadyToPlay:(NSNotification*)aNotification
{
[gsDelegate.view addSubview:movie.view];
[movie.moviePlayer play];
movie.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
}
- (void) myMovieFinishedCallbackIntro:(NSNotification*)aNotification
{
NSNumber* reason = [[aNotification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
NSLog(@"%d",reason);
if(aNotification != nil)
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:movie.moviePlayer];
[gsDelegate movieIntroDidStop];
}
}
NSNumber*êt = [[通知用户Info] ObjectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
pin或“one”
帮助的th(和为我的坏english官 s;op)