ios - 使用 Hyperloop 在 iOS Appcelerator 中播放 Youtube 视频
问题描述
我正在使用 appcelerator 为 iOS 制作应用程序,我陷入了这种情况,就像以前我使用 webview 播放 youtube 视频但现在有些视频没有播放一样。
我在 webview 中尝试了很多但没有成功。所以我用目标 C 编码,它在本地工作。然后我尝试为它制作模块,所以没有成功。
任何人都可以帮助我制作模块或使用超级循环使其工作。以下是我的目标代码,它正在工作: -
UIWebView *videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
videoView.backgroundColor = [UIColor clearColor];
videoView.opaque = NO;
videoView.delegate = self;
NSString *videoUrl = @"http://www.youtube.com/v/1MjC30zo1KA";
NSString *htmlString = [NSString stringWithFormat:@"\
<html>\
<head>\
<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/>\
</head>\
<body style=\"background:#FFF;margin-top:0px;margin-left:0px\"><div><object width=\"320\" height=\"180\"><param name=\"movie\" value=\"%@\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"%@\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"180\"></embed></object></div></body></html>",videoUrl,videoUrl];
[videoView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.youtube.com"]];
这段代码像魅力一样工作,但在使模块应用程序崩溃后,以下行: -
UIWebView *videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
在这种情况下帮助我,在此先感谢。
解决方案
推荐阅读
- react-native - 如何在 react-native 中重新渲染组件?
- mongodb - Mongodb分组子数组
- python - 如何基于另一个 ndarray 最有效地切换一个 ndarray 中的元素
- r - Quanteda 将 fcm 输出转换为 data.frame
- java - 作为 Windows 服务运行时 Jacob COM 桥的问题
- python - 用于桌面应用程序的 Python Speech_recognition
- maven - maven 插件 cucumber-serenity-testlink-integratio 无法解决
- python - 造型多指数熊猫
- perl - 使用 WWW::Mechanize 拉出经过身份验证的 html 页面获取 javascript 错误
- postgresql - Azure PostgreSql 还原