Video autoplay problem in Chrome [closed]

-1

I'm having trouble inserting a video with autoplay into a page on a website, when this page opens in Chrome, the video is stopped until the "play" button is clicked on.

I have read in several "posts" that it is a "bug" and the suggestion is to insert the "muted" attribute in the video tag, however the video is muted and it needs that in addition to the video to start automatically that the video also has sound.

I tried to enable sound via jQuery, but I did not succeed.

Could anyone help me?

Thank you.

    
asked by anonymous 18.12.2018 / 22:40

1 answer

1
___ erkimt ___ Video autoplay problem in Chrome [closed] ______ qstntxt ___

I'm having trouble inserting a video with autoplay into a page on a website, when this page opens in Chrome, the video is stopped until the "play" button is clicked on.

I have read in several "posts" that it is a "bug" and the suggestion is to insert the "muted" attribute in the video tag, however the video is muted and it needs that in addition to the video to start automatically that the video also has sound.

I tried to enable sound via jQuery, but I did not succeed.

Could anyone help me?

Thank you.

    
______ ___ azszpr352004

Use $("video").prop('muted', bool) to enable or disable the sound and% $("video").prop('muted') to check if it is muted.

Example

$("video").prop('muted', true);

$("#mute-video").click(function() {
  if ($("video").prop('muted')) {
    $("video").prop('muted', false);
  } else {
    $("video").prop('muted', true);
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><buttonid="mute-video">Mudo</button>
<video src="http://s3.amazonaws.com/servingsites-videos/firstbaptistchurchofnorfolk/sample-welcome-video-2.mp4"controlswidth="240"></video>
    
___
18.12.2018 / 22:50