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
"<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!
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
<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!