tags:

views:

1273

answers:

5

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?

A: 

Very interesting. Didn't know Mobile Safari had a plugin architecture.

I think your problem is likely twofold.

  1. The way you are loading the URL is causing UIWebView to try to spawn this plugin, which isn't available to UIWebView, just to Mobile Safari.

  2. The URL you are attempting to play is not a supported file type for the iPhone. You say that it plays in Safari so it's probably not 2, but some version of 1.

If you post code maybe we can debug more helpfully.

Good Luck!

Genericrich
+1  A: 

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).

jj
do you need to import anything? I'm getting this error -- warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.1 (8B5080c)/Symbols/System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin/YouTubePlugIn" (file not found).
jmont
You don't need to import anything. Do the videos always fail to play?
jj
A: 

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&amp;f=gdata_videos&amp;c=ytapi-my-clientID&amp;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?

jj
A: 

I'm seeing the same issue, have you solved it?

Plumenator
Update: In my case it turned out that I was adding another "://" to the url. Once I removed that it worked fine.
Plumenator
A: 

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.

jj