0
안녕하세요, 내 비디오 서버에서 내 비디오 데이터베이스를 보려고합니다. mysql 데이터베이스에 비디오 URL을 저장했습니다. json과 PHP 코드를 사용하여 URL을 iOS에 전달하고 있습니다.MPmovieplayer 재생 문제 _itemFailedToPlayToEnd : ios에서
#import "vediopoliticalCell.h"
#import "vedios.h"
@implementation vediopoliticalCell
//@synthesize movieplayer,titile;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
-(void)setDataSource:(vedios *)inVideosObj
{
self.titile.text = inVideosObj.title;
NSURL *url =[NSURL URLWithString:inVideosObj.video];
NSURLRequest *request =[NSURLRequest requestWithURL:url];
connection =[[NSURLConnection alloc] initWithRequest:request delegate:self];
self.responseData = [[NSMutableData alloc]init];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
{
[self.responseData appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
{
NSString *url =[NSString stringWithUTF8String:[self.responseData bytes]];
MPMoviePlayerController *mov = [[MPMoviePlayerController alloc]initWithContentURL: [NSURL URLWithString:url]];
[self.movieplayer.view setFrame:CGRectMake(10,20, 100, 100)];
NSLog(@"vedio %@",mov);
self.movieplayer = mov;
//[self.view addSubview:self.movieplayer.view];
[self.movieplayer prepareToPlay];
[self.movieplayer play];
}
@end
후 :하지만 지금이 내가 테이블 셀
테이블 셀하는 .m 파일 코드에서 볼 수있는 동영상 URL을 가져 오는 데 사용했던 코드 여기
몇 가지 문제를 받고 있어요 이 메신저 코딩 내 테이블에 vedio를 재생할 수 없습니다 전자 휴대
메신저 점점 문제 : 콘솔에서이 같은
2014-01-23 14:36:46.272 video[2123:a0b] vedio <MPMoviePlayerController: 0xa67c440>
2014-01-23 14:36:46.339 video[2123:a0b] _itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}
그래서 pls는