本文介绍了如何在最后一帧的Divi背景中停止视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要您有关 Divi主题的帮助.我在全角部分设置了视频背景.我禁用了循环播放功能,因此在页面加载后,视频只能播放一次.我的问题是:我希望视频在最后一帧停止播放.现在,当视频完成时,显示的图像是第一帧.有什么建议吗?

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??

推荐答案

我遇到了同样的问题.我发现Divi使用MediaPlayer.js,它具有一个选项"autoRewind",您可以将其设置为false.

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.

我修改了ElegantThemes建议的循环以禁用javascript代码段以使其包含在内.这对我有用:

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>

这篇关于如何在最后一帧的Divi背景中停止视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 13:39