2011-03-14 2 views

답변

0

This GData sample Code 사용할 수있는 방법을 더 알아가는 링크를 통해 이동하시기 바랍니다 Youtube 비디오에 관한 정보를 가져 오기위한 GData API의 데이터 나는 다음과 같은 코드의 도움으로

- (void)embedYouTube:(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.view addSubview:videoView]; 
[videoView release];} 

전화 self.youTubeLink이 YouTube 동영상을로드 할 stringURL 포함됩니다이 기능

[self embedYouTube:self.youTubeLink frame:CGRectMake(0, 0, 320, 370)]; 

에있는 UIWebView에서 동영상을 재생하기 위해 사용합니다.