Javascript Jquery移动视频自动播放
我有一个视频,我在我的网站上显示了一个Javascript Jquery移动视频自动播放,javascript,jquery,html,mobile-website,Javascript,Jquery,Html,Mobile Website,我有一个视频,我在我的网站上显示了一个autoplay标签 <video autoplay class="header-image" preload> <source src="<?php print $theme_dir; ?>/img/mobile-banner.mp4" type="video/mp4"> <img class="img-responsive mobile" src="<?php print $
autoplay
标签
<video autoplay class="header-image" preload>
<source src="<?php print $theme_dir; ?>/img/mobile-banner.mp4" type="video/mp4">
<img class="img-responsive mobile" src="<?php print $theme_dir; ?>/img/main-banner-1-mobile.jpg"/>
</video>
但是,手机不显示此视频。有可能自动播放视频吗?如果有,我该如何编写脚本来强制这个机制
如果失败,我可以使用什么方法返回到图像中显示?向我们展示您迄今为止尝试过的内容,因此不是编码服务。很抱歉。我将添加我迄今为止所做的代码。@CarstenLøvboAndersen我的编辑是否提高了我问题的质量?谢谢
(function ($) {
$(document).ready(function () {
var Vid = $('#front-page .mobile video.header-image');
Vid.on('ended', function(){
var thisVideo = Vid[0];
thisVideo.currentTime = 7.9;
thisVideo.play();
});
});
}(jQuery));