jQuery jPlayer自动播放在ipad上不起作用如何显示控件 [英] JQuery jPlayer autoplay not working on ipad how to show controls
问题描述
我正在使用jPlayer在网页上播放视频,以使其与桌面浏览器和iPad兼容.
I am using jPlayer to play video on webpage to make it compatible for desktop browsers and iPad.
我正在使用以下代码
$("#jquery_videoPlayer").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
m4v: _mp4url,
ogv: _oggurl,
webmv: _webmurl,
flv:_url
}).jPlayer("play");
},
swfPath: "../js",
supplied: "m4v, webmv, ogv, flv",
preload:"auto",
loop:true,
solution: "html, flash",
size: {
width: "256px",
height: "240px"
}
});
在所有浏览器上都可以正常工作,但是由于iPad不允许自动播放视频,我需要在视频(HTML5)上显示播放按钮.
It works fine on all browsers however since iPad do not allow autoplay the video I need to show play button on the video (HTML5).
我在文档中找不到任何选择.
I could not find any option for this in the document.
有人可以帮助我对代码进行哪些更改,以便在jPlayer的视频上显示HTML5播放按钮.
Can someone help me to what changes should I make in the code to display HTML5 play button on video for jPlayer.
感谢您的帮助.
推荐答案
nativeVideoControls
是一个包含多个正则表达式值的对象,与浏览器的用户代理匹配.将此添加到您的选项.这是一些例子.
nativeVideoControls
is an object conatining multiple regex values, matched against the browser's user-agent. add this to your options. here are some examples.
nativeVideoControls: {
ipad: /ipad/,
iphone: /iphone/,
android: /android/,
blackberry: /blackberry/,
iemobile: /iemobile/
},
这篇关于jQuery jPlayer自动播放在ipad上不起作用如何显示控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!