Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sophiko

macrumors newbie
Original poster
Jul 9, 2009
1
0
Hi guys,
I have embedded a YouTube player into UIWebView, which works just fine - but I can't seem to make it autoplay when loaded. Here's the html code i load into the webview:

NSString* htmlCode = [NSString stringWithFormat:mad:"<html><head>\
<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = \"%0.0f\"/></head>\
<body style=\"background:#FFF;margin-top:0px;margin-left:0px\">\
<div>\
<object width=\"%0.0f\" height=\"%0.0f\">\
<param name=\"movie\" value=\"http://www.youtube.com/v/U2axsZGci_s&autoplay=1\"</param>\
<param name=\"allowFullScreen\" value=\"true\"></param>\
<embed src=\"http://www.youtube.com/v/U2axsZGci_s&autoplay=1\"\
type=\"application/x-shockwave-flash\"\
allowfullscreen=\"true\"\
width=\"%0.0f\" height=\"%0.0f\">\
</embed>\
</object>\
</div></body></html>"];

[cell.webView loadHTMLString:htmlCode baseURL:nil];

The result is the same, as if autoplay=1 has no effect at all.
Thanks in advance!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.