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

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

概述我的iOS应用程序使用UIWebView上的youtube iframe播放器以内联模式播放任何剪辑.以下代码是使用的 HTML代码. <html><head> <style type="text/css">body {background-color: transparent;color: white;}</style></head> <body style="margin:0" 我的iOS应用程序使用UIWebVIEw上的youtube iframe播放器以内联模式播放任何剪辑.以下代码是使用的 HTML代码.
<HTML><head>     <style type="text/CSS">body {background-color: transparent;color: white;}</style></head> <body ><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服务器以便正常播放.

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

总结

以上是内存溢出为你收集整理的ios – 最近没有在UIWebView上播放iframe播放器的youtube剪辑全部内容,希望文章能够帮你解决ios – 最近没有在UIWebView上播放iframe播放器的youtube剪辑所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1105103.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存