- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
此代码非常适合在 iOS 6 uiwebview 中自动播放内联视频。但是,我升级到 iOS 7,现在我的视频不会自动播放。有时视频会自动播放,有时不会。它会自动播放大约 10% 的时间。大多数时候我得到一个纺车。如果我从 src 标签中删除 &playsinline=1 它将自动全屏播放(不是我想要的)。我花了很多时间为这个应用程序创建一个自定义播放器,但现在它无法正常工作。非常感谢任何帮助。
_youTubeWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 20, 320, 184)];
_youTubeWebView.delegate = self;
_youTubeWebView.scrollView.bounces = NO;
_youTubeWebView.allowsInlineMediaPlayback = YES;
_youTubeWebView.mediaPlaybackAllowsAirPlay = YES;
_youTubeWebView.mediaPlaybackRequiresUserAction = NO;
[self.view addSubview:_youTubeWebView];
NSString* embedHTML = [NSString stringWithFormat:@"<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){ a.target.playVideo(); }</script><iframe id='playerId' type='text/html' width='%@' height='%@'src='http://www.youtube.com/embed/%@?enablejsapi=1&rel=0&playsinline=1&controls=0&showinfo=0' frameborder='0'></body></html>", w, h, videoId];
[_youTubeWebView loadHTMLString:embedHTML baseURL:nil];
这是一个快速测试文件的链接。 videoPlayerTest.zip
最佳答案
这听起来像是针对 Youtube iframe 播放器 API 的以下开放错误:
Issue 5204: js iframe api playVideo() doesn't play video in iOS 7
关于ios - UIWebView youtube iframe api autoplay/playsinline 在 iOS7 中退出工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19235653/
我有一个问题,我的 WordPress 博客嵌入了来自 Imgur 的视频。加载后会自动播放。它还会自动循环。它与此嵌入 HTML 完美配合。但是,当我们将其滚动出屏幕时,它并不会停止。滚出时如何停止
关于为什么嵌入式YouTube视频无法在此站点上自动播放的任何想法? https://quantumleapin.wpengine.com/ 据我所知,自动播放功能已正确集成... 最佳答案 您的sr
因此,我使用Java来仅加载youtube视频的缩略图。单击拇指时,图像div完全替换为在“自动播放”中嵌入的视频。一切都按我想要的工作 在YouTube上,当我查看Google Analytics(
我在 asp.net 网站上使用谷歌音频播放器,我想在页面加载时默认设置 autoplay=true。 最佳答案 许多问题的一个解决方案使用下面的代码:) ........3523697345-aud
我的目标是制作一个自动重复和自动启动的视频幻灯片。不幸的是,视频似乎只是有时自动播放:根据我的实验,如果页面已经加载,或者从网站的其他部分导航到页面,重新加载页面时视频很可能会自动播放。由于该视频本来
我有一个 vimeo 视频,当用户单击 div 时会加载。 这是我的 JavaScript: $(".vimeobox").click(function() { var iframe
有人能帮帮我吗?我知道这里有一些错误。为什么我必须在页眉末尾和页面底部链接 bootstrap.min.js。我尝试一次使用一个,但它不起作用。接下来是我希望在加载页面和单击 Controller 时
我正在为移动用户创建一个 HTML5 音乐网站。目标是让它在移动浏览器中完全运行.. 问题是,当用户选择要播放的轨道时,他们会被带到“播放器”页面。然后我在 HTML5 音频元素中使用 AJAX,并将
如何通过 onmouseover 事件停止 cSlider 的自动播放功能? HTML: Text More text 到目前为止,我对 jQu
代码片段如下。我使用 impress.js 创建在线演示文稿。我想在最后一张幻灯片中插入一个视频,该视频在幻灯片出现时自动播放。但我无法实现这一点。谁能帮我解决这个问题吗? You
我正在使用 html5 视频标签在灯箱中显示视频。视频本身效果很好。但是当我尝试在有人打开灯箱时自动播放它时,我失败了。这是我正在使用的 JavaScript 代码。 触发灯箱的 HTML 工作正常。
我正在为应用程序使用 soundcloud API。我的代码做的第一件事就是在 soundcloud 上获取我最喜欢的轨道。每个轨道都使用 Jquery 显示为 li 元素。当我单击这些列表元素之一时
我有一个样式化组件,它可以为视频标签设置样式。 const Video = styled.video` ... ` 我也是这样用的 但是 autoplay 属性不起作用,当我使用 Dev
我得到了以下 HTML: 我将如何删除 autoplay完全来自 元素? 我试过类似下面的方法: //Attempt jQuery('video').remove('autoplay'); //At
到目前为止,我所有的研究和努力都在这方面碰壁:目前有什么方法可以让视频在 iOS 的 Safari 上自动播放吗? 有些人提到了视频转码或使用 playsinline(适用于 Android),但对
我需要能够在 Twitter Bootstrap 模式打开时自动播放 YouTube 视频,并随后在关闭时停止该视频。 我知道这个问题之前已经被问过,但我能找到的答案会导致包含许多视频的页面出现大量
我有一个使用 HTML5 设置的 ogg vorbis 文件 标签。 Firefox (3.6.13) 请求该文件两次,但使用“自动播放”选项时,两个请求的文件都会播放。 当我暂停时,其中一首轨道停止
A 获取一些带有 ?autoplay=1 的 URL 我想做一个 str.replace() 来删除这个 ?autoplay=1 来自 url。 现在我有这样的东西不起作用 val.replace('
我想通过 AMS 8 连接到我的主机上的 Mysql 数据库数据库远程已打开,我在远程 mysql 中添加了 % 以允许任何 IP 访问数据库你能给我一个简单的代码吗??? 最佳答案 您必须首先在 A
我遇到了这个问题。 我正在通过自定义字段传递它 here (注意“autoplay=1”) 但是当我使用 wp_oembed_get 在我的主题上加载视频时...它可以很好地显示视频,但它不会听取我的
我是一名优秀的程序员,十分优秀!