WordPress Revolution Slider:取消静音失败,元素被暂停,因为用户之前没有与文档交互

WordPress Revolution Slider: Unmuting failed and the element was paused instead because the user didn't interact with the document before

我试图在 ThemePunch Slider Revolution 5.4.2 中自动播放视频时 运行 出现以下 JavaScript 错误(在 Google Chrome):

Unmuting failed and the element was paused instead because the user didn't interact with the document before. revolution.extension.video.min.js:7

OP 的回答:

在网上苦苦思索了 3 天后,我决定打开出现错误的脚本,即:

revolution.extension.video.min.js

我删除了整个第 7 行,即以下代码:

c=void 0!=c&&"mute"!=c?parseFloat(c)/100:c,d||(!0===e.globalmute?q.muted=!0:q.muted=!1,c>1&&(c/=100),"mute"==c?q.muted=!0:void 0!=c&&(q.volume=c)),a.addClass("videoisplaying");

这解决了我的问题!

您不必编辑插件本身,这很危险。

旋转滑块API可用于在页面加载时强制播放视频

revapi1.bind("revolution.slide.onvideostop",function (e,data) { var player = data.video; player.play(); });

在滑块设置 > 自定义中添加此项 JavaScript

有关多媒体播放政策变更的信息请查看https://www.themepunch.com/faq/video-audio-changes-safari-chrome/