Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem loading Youtube videos
    text
    copied!<p>I'm trying to launch embedded Youtube videos from a UIWebView, but get this error in the console when selecting them from the phone:</p> <p>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).</p> <p>The URL is good, since I can play it from Safari just fine.</p> <p>Anyone have the problem?</p> <h2>Update:</h2> <p>Man, I'm always impressed at how responsive this forum is.</p> <p>Anyway, here is the embed code that I found on the web and tweaked:</p> <pre><code>- (void)embedYouTube { NSString* embedHTML = @"\ &lt;html&gt;&lt;head&gt;\ &lt;style type=\"text/css\"&gt;\ body {\ background-color: transparent;\ color: white;\ }\ &lt;/style&gt;\ &lt;/head&gt;&lt;body style=\"margin:0\"&gt;\ &lt;embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\"&gt;&lt;/embed&gt;\ &lt;/body&gt;&lt;/html&gt;"; 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); } </code></pre> <p>I put the sample URL in, uhh, 'url' above to show which URL I'm using (whew, lots of urls). </p> <h2>Update 2:</h2> <p>So I even went to this URL:</p> <p><a href="http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html" rel="nofollow noreferrer">http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html</a></p> <p>and copied their example code here:</p> <pre><code>[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/v/oHg5SJYRHA0&amp;f=gdata_videos&amp;c=ytapi-my-clientID&amp;d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM"]]; </code></pre> <p>from that article written on 2/5/09, and it launches the Youtube player, but I get "Youtube not available."</p> <p>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?</p> <hr> <p>Man, I'm always impressed at how responsive this forum is.</p> <p>Anyway, here is the embed code that I found on the web and tweaked:</p> <pre><code>- (void)embedYouTube { NSString* embedHTML = @"\ &lt;html&gt;&lt;head&gt;\ &lt;style type=\"text/css\"&gt;\ body {\ background-color: transparent;\ color: white;\ }\ &lt;/style&gt;\ &lt;/head&gt;&lt;body style=\"margin:0\"&gt;\ &lt;embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\"&gt;&lt;/embed&gt;\ &lt;/body&gt;&lt;/html&gt;"; 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); } </code></pre> <p>I put the sample URL in, uhh, 'url' above to show which URL I'm using (whew, lots of urls). </p> <hr> <p>So I even went to this URL:</p> <p><a href="http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html" rel="nofollow noreferrer">http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html</a></p> <p>and copied their example code here:</p> <pre><code>[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/v/oHg5SJYRHA0&amp;f=gdata_videos&amp;c=ytapi-my-clientID&amp;d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM"]]; </code></pre> <p>from that article written on 2/5/09, and it launches the Youtube player, but I get "Youtube not available."</p> <p>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?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload