如何在不必按下播放按钮的情况下自动播放视频。
答案 0 :(得分:1)
MPMoviePlayerController *player = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL fileURLWithPath:@"yourVideoPath"]];
player.shouldAutoplay=YES;
player.view.frame = CGRectMake(0.0, 0.0, 480.0, 320.0);
player.movieSourceType = MPMovieSourceTypeFile;
player.controlStyle = MPMovieControlStyleEmbedded;
[self.view addSubview:player.view];
这应该可以解决您的问题。尝试和测试