1
我使用這個代碼,看YouTube視頻可以使用此代碼在模擬器上檢查YouTube視頻嗎?
- (YouTubeView *)initWithStringAsURL:(NSString *)urlString frame:(CGRect)frame;
{
if (self = [super init])
{
// Create webview with requested frame size
self = [[UIWebView alloc] initWithFrame:frame];
// HTML to embed YouTube video
NSString *youTubeVideoHTML = @"<html><head>\
<body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
// Populate HTML with the URL and requested frame size
NSString *html = [NSString stringWithFormat:youTubeVideoHTML, urlString, frame.size.width, frame.size.height];
// Load the html into the webview
[self loadHTMLString:html baseURL:nil];
}
return self;
}
現在我無法看到的simulator..however白色的WebView相對視頻快到那裏..
那麼是否有類似的情況,我無法在模擬器上看到youtube視頻,或者代碼中是否存在其他問題?
是白色的webview在那裏:) – 2011-06-01 09:04:26
done ... thankuuu – 2011-06-01 15:29:33