无法阻止视频开始

时间:2014-02-07 12:17:38

标签: ios video

我正在查看tableview中的视频数组,使用我服务器的网址即可获得视频播放的一些问题。我无法暂停视频,只有第一个视频暂停,所有剩余的视频都会自动播放。

如何浏览所有视频?

这是我用过的代码

 self.titile.text = inVideosObj.title;
url =[NSURL URLWithString:inVideosObj.video];

NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:url];
NSLog(@"UDSA %@  %@ ",url,request);


connection =[[NSURLConnection alloc] initWithRequest:request delegate:self];
self.responseData = [[NSMutableData alloc]init];
MPMoviePlayerController *mov = [[MPMoviePlayerController alloc]initWithContentURL:  [NSURL URLWithString:inVideosObj.video]];
NSLog(@"length %d",[self.responseData length]);


self.movieplayer = mov;
[self.movieplayer.view setFrame:CGRectMake(10,20, 100, 100)];

// self.movieplayer.movieSourceType = MPMovieSourceTypeFile;
[self.contentView addSubview:self.movieplayer.view];
    [self.movieplayer prepareToPlay];
[self.movieplayer pause];

感谢

1 个答案:

答案 0 :(得分:0)

尝试禁用自动播放:

 self.movieplayer.shouldAutoplay = NO;

设置默认为YES