Ios 播放控制按钮不是';从uiwebview播放youtube视频时未显示

Ios 播放控制按钮不是';从uiwebview播放youtube视频时未显示,ios,swift,youtube,Ios,Swift,Youtube,我正在尝试在Swift的UIWebView中播放YouTube视频,当视频全屏播放时,我在标题上看到一条消息,播放按钮没有显示,我尝试了所有方法并尝试使用google的YTPlayerView,但这是同一个问题,请帮我解决这个问题 代码如下: let htmlString = "<html><body style='margin:0px;padding:0px;'><script type='text/javascript' src='http://www.you

我正在尝试在Swift的UIWebView中播放YouTube视频,当视频全屏播放时,我在标题上看到一条消息,播放按钮没有显示,我尝试了所有方法并尝试使用google的YTPlayerView,但这是同一个问题,请帮我解决这个问题

代码如下:

let htmlString = "<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){}</script><iframe
 id='playerId' type='text/html' width='\(UIScreen.mainScreen().bounds.width)' height='\(self.imageCollectionView.frame.height)' src='\(url!.description)?enablejsapi=1&rel=0&playsinline=1&autoplay=1' frameborder='0'></body></html>"

cell.vedioWebPage.allowsInlineMediaPlayback = true
cell.vedioWebPage.mediaPlaybackRequiresUserAction = false

cell.vedioWebPage.loadHTMLString(htmlString, baseURL: NSBundle.mainBundle().resourceURL)
让htmlString=”
作用
onYouTubeIframeAPIReady(){ytplayer=new YT.Player('playerId',{事件:
{onReady:onPlayerReady}}}函数onPlayerReady(a){}”
cell.vedioWebPage.allowsInlineMediaPlayback=true
cell.vedioWebPage.mediaplaybackrequiresseraction=false
cell.vedioWebPage.loadHTMLString(htmlString,baseURL:NSBundle.mainBundle().resourceURL)
下面是一个屏幕截图: