怎样用 UIWebView 的 loadHTML 方法加载一段 HTML 标签实现视频播放?
后台返回HTML 标签,内嵌视频,可以用浏览器打开,但是用 UIWebView 没有反应。代码如下
UIWebView *web = [[UIWebView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:web];
web.allowsInlineMediaPlayback = YES;
web.delegate = self;
self.web = web;
NSString *str1 = @"<html><head lang=\"en\"><meta charset=\"UTF-8\"><title></title></head><body>";
NSString *str2 = @"</body></html>";
NSString *content = @"<embed type=\"application/x-shockwave-flash\" class=\"edui-faked-video\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://player.youku.com/player.php/sid/XMTcxNzM3MzE2MA==/v.swf?beta&f=27865525&o=1&spm=0.0.m_213480.5~5~5~5~5~5!2~5~5!2~A.2aTtJI&from=y1.3-music-new-140-21793.213123-213237-213480.2-1#paction\" width=\"420\" height=\"280\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/>";
NSString * html = [NSString stringWithFormat:@"%@%@%@",str1,content,str2];
[web loadHTMLString:html baseURL:nil];
请问如何实现?多谢多谢
으아악
참조: http://stackoverflow.com/ques...