iOS 6, Xcode 4.5 video not exiting when done playing

自古美人都是妖i 提交于 2019-12-06 10:49:02
Stanley

try this, hope it helps

-(void)GrommeVideo4
{
    NSURL *url5 = [NSURL fileURLWithPath:[[NSBundle mainBundle]
                                      pathForResource:@"Flickers" ofType:@"mp4"]];
    grommePlayer4 =  [[MPMoviePlayerController alloc]
                  initWithContentURL:url5];

    grommePlayer4.controlStyle = MPMovieControlStyleDefault;
    grommePlayer4.shouldAutoplay = YES;
    [self.view addSubview:grommePlayer4.view];
    [grommePlayer4 setFullscreen:YES animated:YES];
}

-(void) moviePlayBackDidFinish:(NSNotification *)aNotification{
    [grommePlayer4.view removeFromSuperview];
    grommePlayer4 = nil;
}


- (void)moviePlayerWillExitFullscreen:(NSNotification*) aNotification {
    [grommePlayer4 stop];
    [grommePlayer4.view removeFromSuperview];
    grommePlayer4 = nil;
}

Did you try to also stop the player in moviePlayBackDidFinish?

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