Use this code to add a tube to your application.
To do this, you need to configure the web view in your view. Then call the loadHTMLString:baseURL: method on the UIWebView instance using some carefully crafted HTML containing a snippet of YouTube embedded player code and some supporting HTML to make sure the thumbnail of the video is displayed correctly. Set the base URL of your site’s URL (it doesn’t do anything here - usually UIWebView uses it to properly handle relative URLs).
NSString *youTube = @"<html><head> <meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/></head> <body style=\"background:#F00;margin-top:0px;margin-left:0px\"> <div><object width=\"212\" height=\"172\"> <param name=\"movie\" value=\"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"></param> <param name=\"wmode\" value=\"transparent\"></param> <embed src=\"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"212\" height=\"172\"></embed> </object></div></body></html>"; [webView loadHTMLString:youTube baseURL:[NSURL URLWithString:@"http://www.your-url.com"]];
Further link: YouTube
source share