Why do I report an error when I slide to automatically play the video?

when my page slides to a certain distance, it automatically plays a total of two videos, but it will report an error

clipboard.png

clipboard.png

clipboard.png
it doesn"t work even if I find some methods

Mar.19,2021

first pause () and then play () try. I seem to have encountered similar problems before. After a long time, I forgot


if the sound is played automatically when "the page slides to a certain distance", is a strong x user , so browsers are not allowed to do so.

The autoplay policy of

Chrome goes like this:

  1. No sound, whatever;
  2. there is sound, and it only works in the following situations:

    • has user behavior ( click , tap , etc);
    • for the desktop side, it is possible to calculate whether users visit the site frequently according to an index.
    • for mobile, the user puts the site on home screen.

now the recommended practice for browsers is to add muted first, and then turn on the sound when the user clicks.

</button>

<script>
  unmuteButton.addEventListener('click', function() {
    video.muted = false;
  });
</script>
Menu