0
기존 응용 프로그램에 문제가 있습니다. 응용 프로그램이 UIScrollView에서 응용 프로그램 내에서 유튜브 비디오를 재생하지만, 새로운 Xcode SDK 4.5.2를 설치 한 후에 문제가 발생합니다유튜브 비디오 프레임이 iOS 6에서 보이지 않거나 재생되지 않음
- (void)playVideo:(NSString *)urlString frame:(CGRect)frame
{
NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
NSString *html = [NSString stringWithFormat:embedHTML, urlString, frame.size.width, frame.size.height];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:nil];
[self.scrollView addSubview:videoView];
[videoView release];
NSLog(@"%@",html);
}
- (void)viewDidLoad
{
[self playVideo:@"http://www.youtube.com/...." frame:CGRectMake(5, 20, 110, 110)];
[self playVideo:@"http://www.youtube.com/...." frame:CGRectMake(5, 170, 110, 110)];
[self playVideo:@"http://www.youtube.com/...." frame:CGRectMake(5, 320, 110, 110)];
[self playVideo:@"http://www.youtube.com/...." frame:CGRectMake(5, 470, 110, 110)];
[self playVideo:@"http://www.youtube.com/...." frame:CGRectMake(5, 620, 110, 110)];
[self playVideo:@"http://www.youtube.com/...." frame:CGRectMake(5, 765, 110, 110)];
[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(320,1400)];
[super viewDidLoad];
}
은 내가이 변화 할 필요가 모르는 : 비디오는 빈 흰색 사각형을 가지고 있고 그들은 내가 그들에게 누를 때 사용처럼 그들은 작동하지 않는, 여기에 내가 내 애플 리케이션에있는 코드입니다 코드를 표시하고 다시 재생하도록하는 코드입니다.