1
- (void)embedYouTube:(NSString*)url frame:(CGRect)frame {
NSString *htmlString = [NSString stringWithFormat:<html><head>\
<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/></head>\
<body style=\"background:#F00;margin-top:0px;margin-left:0px\">\
<div><object width=\"100\" height=\"100\">\
<param name=\"movie\" value=\"%@\"></param>\
<param name=\"wmode\" value=\"transparent\"></param>\
<embed src=\"%@\"\
type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"100\" height=\"100\"></embed>\
</object></div></body></html>",url,url];
webView = [[UIWebView alloc] initWithFrame:frame];
webView.delegate = self;
[webView setScalesPageToFit:TRUE];
[webView setContentMode:UIViewContentModeTop];
[self.view addSubview:webView];
[webView loadHTMLString:htmlString baseURL:nil];
}
我已经实现了上面的代码。它在iPhone上运行良好,但在iPad上我只听到音频,视频不显示。如何嵌入ipad的视频网址
如何在两种类型的设备上进行此项工作?
感谢您的回放,但它不能这样做,因为它不能像播放器一样在播放器中直接播放视频,并在设备(真正的iPhone或iPod)中播放。 –