Try using this code to initialize an iframe player:
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: 'M7lc1UVf-VE',
playerVars: {
'controls' : '0',
'playsinline' : 1
}
});
, "playinline" 1. UIWebView :
webView.allowsInlineMediaPlayback = YES;
, , , baseURL NULL; NSString. , HTML iframe-player.html, HTML JavaScript:
NSString *path = [[NSBundle mainBundle] pathForResource: @"iframe-player" ofType: @"html"];
NSString *embedHTML = [NSString stringWithContentsOfFile: path
encoding:NSUTF8StringEncoding
error: &error];
[webView loadHTMLString:embedHTML baseURL:[NSURL URLWithString:@"about:blank"]];