I'm a noob to iphone development and I am having trouble displaying an embedded youtube video within a UIwebview. Currently, the youtube video sits in the top left hand corner of the uiwebview and it also has an annoying border. I set the youtube frame to the same dimensions as my uiwebview and the webview is set to "scale to fit". How do I make my youtube content fit the entire screen and get rid of the border? Any help is greatly appreciated.
MY CODE
NSString *video_ID = youtubeid;
NSString *htmlStr = [NSString stringWithFormat:@"<iframe class=\"youtube-player\" type=\"text/html\" width=\"320\" height=\"230\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\"></iframe>",video_ID];
[videoScreen loadHTMLString:htmlStr baseURL:nil];
EDIT
NSString *video_ID = youtubeid;
NSString *htmlStr = [NSString stringWithFormat:@"<iframe class=\"youtube-player\" type=\"text/html\" width=\"100%\" height=\"100%\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\"></iframe>",video_ID];
[videoScreen loadHTMLString:htmlStr baseURL:nil];
Have u tried this......
NSString *video_ID = youtubeid;
NSString *htmlStr = [NSString stringWithFormat:@"<iframe class=\"youtube-player\" type=\"text/html\" width=\"100%%\" height=\"100%%\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\"></iframe>",video_ID];
[videoScreen loadHTMLString:htmlStr baseURL:nil];
Note That %% is used for % character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With