<html> <head> <style type="text/css">body {background-color: transparent;color: white;}</style> </head> <body style="margin:0"> <iframe src="http://www.youtube.com/embed/e2w8z6mI47U?playsinline=1&rel=0&showinfo=0" width="320" height="240" frameborder="0" allowfullscreen></iframe> </body> </html>
然后,它传递给loadHTMLString方法.
该代码在最近的日期之前运作良好.但是,我最近注意到我使用的每个剪辑都没有正常播放.显示待机视图和播放按钮,但是,虽然我按了播放按钮,但播放效果不佳.黑屏只显示.
解决方法
我不知道为什么这个方法可以救我.猜测,有一个变化涉及在youtube上播放的请求.我可以在youtube开发者网站上找到以下更改.
January 28,2014
The playsinline parameter controls whether videos play inline or
fullscreen in an HTML5 player on iOS. Setting the value to 1 causes
inline playback.The Selecting content to play section has been updated to explain how
to find YouTube video IDs and playlist IDs using the YouTube Data API
(v3) rather than the older API version.The controls parameter’s definition has been updated to reflect the
fact that the parameter value only affects the time that the Flash
player actually loads in IFrame embeds. In addition,for IFrame
embeds,the parameter value also determines when the controls display
in the player. If you set the parameter’s value to 2,then the
controls display and the Flash player loads after the user initiates
the video playback.
我猜上面的一个更改可能需要额外的信息,这些信息从客户端传递到youtube服务器以便正常播放.