- Get link
- Other Apps
Youtube video can be played in iOS app using webview. MPMoviePlayerController is not able to open youtube video automatically. Integrate the below script to show thumbnail, clicking on it the video will play in full screen. NSString *url = @"https://www.youtube.com/embed/8aMHGC6A5zc" ; NSString * embedHTML = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: white;\ }\ </style>\ </head><body style=\"margin:0\">\ <iframe id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\" frameborder=\"0\" feature=player_detailpage allowfullscreen></iframe>\ </body></html>" ; NSString * html = [ NSString stringWithFormat :embedHTML, url, self . view . frame . siz