Chrome autoplay video not working

2019-09-22 03:02发布

问题:

The Autoplay background video on our website https://webdesign-weinstrasse.de is not working. I know about the new policy but the video has no audio-track.

Does anyone have an idea or answer?

Thanks Udo

回答1:

Tested your video source which is in WP RevSlider. Even though your video do not have audio track. But it will still need autoplay and muted tag in video tag. By that way it will autoplay muted in chrome. Check following for more details.

You can add extra parameter using RevSlider settings which you are using right now. Check following. Ref.https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters

OR TRY FOLLOWING I added muted tag using jquery. You can use that for your revslider video.

$( document ).ready(function() {
     console.log( "ready!" );
	  $("video").prop("autoplay",true);
	  $("video").prop("muted",true);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<video loop width="1920" height="1080" id="mejs_0720491071360283_html5" preload="auto" src="https://webdesign-weinstrasse.de/wp-content/uploads/2018/02/weinberg.mp4" style="margin: 0px; width: 1616px; height: 909px;">
  <source type="video/mp4" src="https://webdesign-weinstrasse.de/wp-content/uploads/2018/02/weinberg.mp4" />
  <source type="video/webm" src="https://webdesign-weinstrasse.de/wp-content/uploads/2017/02/On-the-vine.webm" />
</video>