问题描述
我需要您对 Divi 主题 的帮助.我在全角部分设置了视频背景.我禁用了循环,因此视频仅在页面加载时播放一次.我的问题是:我希望视频在最后一帧停止.现在,当视频完成时,显示的图像是第一帧.有什么建议吗??
推荐答案
我遇到了同样的问题.我发现 Divi 使用 MediaPlayer.js,它有一个选项"autoRewind",您可以将其设置为 false.
我修改了 ElegantThemes 推荐的循环禁用 javascript 片段以包含它.这对我有用:
<script> (function($) { $(document).ready(function() { $('.no-loop').each(function() { $(this).find('video').removeAttr('loop'); }); $('video').mediaelementplayer({ autoRewind: false }); }); })(jQuery); </script>
问题描述
I want your help about Divi theme. I set a video background in a fullwidth section. I disabled loop so the video plays only once when the page is loaded. My problem is this: I want the video to stop at the last frame. Now, when the video is completed the image which displays is the first frame. Any suggestions??
推荐答案
I ran into the same problem. I figured out that Divi uses MediaPlayer.js which has an option "autoRewind" which you can set to false.
I modified the ElegantThemes recommended loop disable javascript snippet to include it. This worked for me:
<script> (function($) { $(document).ready(function() { $('.no-loop').each(function() { $(this).find('video').removeAttr('loop'); }); $('video').mediaelementplayer({ autoRewind: false }); }); })(jQuery); </script>