ios – 最近没有在UIWebView上播放iframe播放器的youtube剪辑

我的iOS应用程序使用UIWebView上的youtube iframe播放器以内联模式播放任何剪辑.以下代码是使用的 HTML代码.
<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 Iframe球员的任何变化或我错过的分数?

解决方法

我最后通过调用[videoView setmediaplaybackRequiresUserAction:NO]来解决问题.
我不知道为什么这个方法可以救我.猜测,有一个变化涉及在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服务器以便正常播放.

更新:今天,我发现没有我的解决方案它运作良好.似乎问题最近得到解决.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...