0

I have a video in my code but I can not make it auto play without muting it. The video has sound but it would auto play without it being muted.

<video autoplay muted loop id="myVideo">
  <source src="weddingv.mp4" type="video/mp4">
</video>
Anonymous
  • 1
  • 1
  • 1
  • 1
  • What is your code so far for the autoplay feature? (that you want to change the mute on) – Jeremy Feb 21 '20 at 16:18
  • that's a very annoying feature, personally – Eduards Feb 21 '20 at 16:20
  • Most (all?) of the major browsers are cracking down on this. Here's Chrome's write-up: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes . Probably the easiest thing you can do is make an easy-to-find "un-mute" button for users to click if they want sound. – WGriffing Feb 21 '20 at 16:27
  • Does this answer your question? [HTML5 video autoplay not working in chrome](https://stackoverflow.com/questions/52830264/html5-video-autoplay-not-working-in-chrome) – sanoj lawrence Feb 21 '20 at 16:34
  • does this solves your problem https://stackoverflow.com/a/49822987/3836908 – sanoj lawrence Feb 21 '20 at 16:35

3 Answers3

4

Autoplaying w/ sound

On some browsers, autoplaying with sound does work. However on Chrome it hasn't worked without the mute attribute for some time.

This is well documented here.


Can't you trick Chrome?

Unfortunately you can't trick it by giving it the mute attribute and then unmuting in JavaScript. It also won't work if you try to play the video on page load through JavaScript.

I hope this points you in the right direction.

Halden Collier
  • 845
  • 7
  • 18
0

Browsers get more and more strict about not allowing non-muted videos to autoplay. It's even worse on mobile devices (very much especially iOS). In my experience (which, sadly, is extensive on this issue), trying to trick browsers (especially iOS browsers) into doing your bidding when it comes to video by using JavaScript makes matters even worse (videos start playing in their own window, not inline in your web page, as you presumably want). I say that after combing SO and other sources for solutions.

If for some reason you are not targeting mobile devices, there might be hope here. Otherwise, I'd strongly suggest not wasting more time.

avocadatoria
  • 493
  • 3
  • 9
0

As per New Policy - https://developer.chrome.com/blog/autoplay/#new-behaviors. There should be User Interactions to AutoPlay any Videos with Sounds.

Here is an example solution for the same:-

HTML5 Video autoplay with sound unmuted

Hope it works for you and in case it is a different in which you struck then let me know.

Speeday
  • 63
  • 8