- (void)embedYouTube:(NSString*)url 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, url, frame.size.width, frame.size.height];
if(videoView == nil) {
videoView = [[UIWebView alloc] initWithFrame:frame];
[self.view addSubview:videoView];
}
[videoView loadHTMLString:html baseURL:nil];
}
'iOS Programming' 카테고리의 다른 글
xcode4 초간단 살펴보기 (0) | 2011.03.10 |
---|---|
구글 챠트를 이용해 iOS에서 챠트 쉽게 구현하기 (0) | 2011.01.05 |
UIWebView에서 현재의 웹주소와 웹문서 제목 가져오기 (0) | 2010.09.16 |
아이폰sdk에서 내가 만든 delegate로 파라미터 잔송하기 (0) | 2010.09.10 |
아이폰SDK에서 첨부파일 포함하여 밀티파트 폼포스트로 웹전송하기 (0) | 2010.09.10 |