【发布时间】:2009-03-24 23:34:25
【问题描述】:
我正在尝试从 UIWebView 启动嵌入式 Youtube 视频,但从手机中选择它们时在控制台中出现此错误:
警告:无法读取“/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2/Symbols/System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin/YouTubePlugIn”的符号(未找到文件)。
网址很好,因为我可以从 Safari 播放它。
有人有问题吗?
更新:
伙计,我总是对这个论坛的响应速度印象深刻。
无论如何,这是我在网上找到并调整的嵌入代码:
- (void)embedYouTube {
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>";
CGRect frame;
frame.size.width=100; frame.size.height=80;
frame.origin.x=10; frame.origin.y=10;
NSString *url=@"http://www.youtube.com/watch?v=g8thp78oXsg";
NSString* html = [NSString stringWithFormat:embedHTML,url, 100, 80];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:[NSURL URLWithString:nil]];
[self.view addSubview:videoView];
[videoView release];
NSLog(@" in embed %@",html);
}
我将示例 URL 放在上面的“url”中,以显示我正在使用的 URL(哇,很多 url)。
更新 2:
所以我什至去了这个网址:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
并在此处复制他们的示例代码:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM"]];
从 2009 年 2 月 5 日写的那篇文章开始,它启动了 Youtube 播放器,但我得到“Youtube 不可用”。
我尝试了 Youtube 帖子,但没有回应。任何人都知道如何让这个简单的功能发挥作用吗?或者这可能与我的 iPhone 有关?
伙计,我总是对这个论坛的响应速度印象深刻。
无论如何,这是我在网上找到并调整的嵌入代码:
- (void)embedYouTube {
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>";
CGRect frame;
frame.size.width=100; frame.size.height=80;
frame.origin.x=10; frame.origin.y=10;
NSString *url=@"http://www.youtube.com/watch?v=g8thp78oXsg";
NSString* html = [NSString stringWithFormat:embedHTML,url, 100, 80];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:[NSURL URLWithString:nil]];
[self.view addSubview:videoView];
[videoView release];
NSLog(@" in embed %@",html);
}
我将示例 URL 放在上面的“url”中,以显示我正在使用的 URL(哇,很多 url)。
所以我什至去了这个网址:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
并在此处复制他们的示例代码:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM"]];
从 2009 年 2 月 5 日写的那篇文章开始,它启动了 Youtube 播放器,但我得到“Youtube 不可用”。
我尝试了 Youtube 帖子,但没有回应。任何人都知道如何让这个简单的功能发挥作用吗?或者这可能与我的 iPhone 有关?
【问题讨论】:
-
我在 iPhone 上观看 Choclate Rain YouTube 视频时也遇到了问题。
-
您好我有同样的问题,但它是随机发生的。有时它可以工作,有时它会使我的应用程序崩溃。我对至少阻止应用程序崩溃的任何方式非常感兴趣。有趣的是,我将我的构建链接到 2.0 库....这可能是问题吗?贡索
标签: iphone