Ho provato con i seguenti e Youtube il video riprodotto automaticamente con successo in fullscreen quando visualizzazione Web finitura di carico:
[self.webView setAllowsInlineMediaPlayback:YES];
[self.webView setMediaPlaybackRequiresUserAction:NO];
[self.view addSubview:self.webView];
NSString* embedHTML = [NSString stringWithFormat:@"\
<html>\
<body style='margin:0px;padding:0px;'>\
<script type='text/javascript' src='http://www.youtube.com/iframe_api'></script>\
<script type='text/javascript'>\
function onYouTubeIframeAPIReady()\
{\
ytplayer=new YT.Player('playerId',{events:{onReady:onPlayerReady}})\
}\
function onPlayerReady(a)\
{ \
a.target.playVideo(); \
}\
</script>\
<iframe id='playerId' type='text/html' width='100%%' height='%f' src='http://www.youtube.com/embed/%@?enablejsapi=1&rel=0&playsinline=0&autoplay=1' frameborder='0'allowfullscreen>\
</body>\
</html>",self.webView.frame.size.height,@"Dw9jFO_coww"];
[self.webView bringSubviewToFront:self.btnBack];
self.webView.backgroundColor = [UIColor clearColor];
self.webView.opaque = NO;
[self.webView loadHTMLString:embedHTML baseURL:[[NSBundle mainBundle] resourceURL]];
fonte
2016-03-30 06:37:03
thnaks. lasciami cancellare la mia domanda –
@AvisekChakraborty: per favore non cancellarlo. Si tratta comunque di informazioni utili, anche se la risposta non è quella che speravi. –
si. sicuramente non lo sto cancellando. thnx –