I’m trying to launch embedded Youtube videos from a UIWebView, but get this error in the console when selecting them from the phone:
warning: Unable to read symbols for “/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2/Symbols/System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin/YouTubePlugIn” (file not found).
The URL is good, since I can play it from Safari just fine.
Anyone have the problem?
Update:
Man, I’m always impressed at how responsive this forum is.
Anyway, here is the embed code that I found on the web and tweaked:
- (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);
}
I put the sample URL in, uhh, ‘url’ above to show which URL I’m using (whew, lots of urls).
Update 2:
So I even went to this URL:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
and copied their example code here:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM"]];
from that article written on 2/5/09, and it launches the Youtube player, but I get “Youtube not available.”
I tried the Youtube postings, but no response. Anyone have any idea how to get even this simple function to work? Or is this something to do with my iPhone maybe?
Man, I’m always impressed at how responsive this forum is.
Anyway, here is the embed code that I found on the web and tweaked:
- (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);
}
I put the sample URL in, uhh, ‘url’ above to show which URL I’m using (whew, lots of urls).
So I even went to this URL:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
and copied their example code here:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM"]];
from that article written on 2/5/09, and it launches the Youtube player, but I get “Youtube not available.”
I tried the Youtube postings, but no response. Anyone have any idea how to get even this simple function to work? Or is this something to do with my iPhone maybe?
This was awhile ago, but I also was adding extraneous characters and my embed code was changed.
Also, to note some videos are just either not available, haven’t been converted to h.264 yet, etc.
I still get the error (i.e.):
warning: Unable to read symbols for “/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2.1 (7B405)/Symbols/System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin/YouTubePlugIn” (file not found).
But videos still play if they can be played. So I think the fact that the symbol library cannot be found console message is a “red herring” thrown before the plugin launches.