我正在尝试在页面中弹出一个HTML5视频自动播放(在静音状态下)。加载页面时,弹出窗口将被隐藏。当用户试图走出页面(从顶部)时,它会显示带有AutoPlay &静音的视频弹出。然后我试着用JavaScript播放视频,但是它给出了一个错误:play() failed because the user didn't interact with the document first.
如果我单击页面上的某个位置,或者在显示视频弹出之前,开发人员面板是打开的,它就可以正常工作。我正在使用Flow Player,并且只在中发布(在FF上运行得很好)。
你能给我一些如何克服这个问题的想法
我的inedx.html是通过播放全屏视频启动的,当视频结束时按钮将出现在屏幕上,点击按钮它将重定向到另一个页面,但我的问题是当我使用“自动播放静音”属性时,音频是静音的,我想播放视频以及音频如何实现这一点。
$(document).ready(function() {
// Hide the div
$(".btn").hide();
// Show the div after 5s
$(".btn").delay(1000).fadeIn(1000);
});
function ak() {
window.location.href
我在我的网站上的HTML背景视频中添加了一个播放按钮,这样用户就可以选择是否播放视频。添加视频的代码如下: <video id="mobilevideo" class="video-full" loop muted playsinline>
<source src="<?php echo esc_url( $videofile ); ?>" type="video/mp4">Your browser does not support the video tag.
</video>