# Autoplay attribute doesn't work

**URL:** <https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269>\
**Category:** HTML/CSS\
**Created:** [March 14, 2022, 8:21pm UTC](https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269 "2022-03-14T20:21:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrekungfu90](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@andrekungfu90](https://forum.codewithmosh.com/u/andrekungfu90)\
**Post date:** [March 14, 2022, 8:21pm UTC](https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269/1 "2022-03-14T20:21:12Z")

</div>

```
<video controls autoplay src="videos/ocean.mp4"></video>

```

When i try to render the main page, autoplay doesn’t start, even if i insert the video attribute “autoplay”. i am using chrome as a browser

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [March 15, 2022, 6:08am UTC](https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269/2 "2022-03-15T06:08:04Z")

</div>

> [@Autoplay not happening with chrome version 88](https://forum.codewithmosh.com/t/autoplay-not-happening-with-chrome-version-88/2981/2):
>
> While other browsers have a setting how to deal with autoplay media Chrome hasn’t and seems to decide on it’s own when to autplay media. If your video is a design element of your page it often helps to set the muted attribute of the video tag. If not, reconsider if you really want to autoplay it. Many users find autoplaying media annoying. And BTW: You should not use blanks in src. If you are in control of the file names consider removing the spaces but at least URL-encode them.

---

<div class="post-metadata">

**Author:** ![andrekungfu90](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@andrekungfu90](https://forum.codewithmosh.com/u/andrekungfu90)\
**Post date:** [March 15, 2022, 6:26pm UTC](https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269/3 "2022-03-15T18:26:25Z")

</div>

So i have just set the muted attribute and it works. But why is it working? I mean. Why should i use the muted attribute to let it work? I’ll try to run it in a different browser as well anyway.  
Thanks

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [March 18, 2022, 5:55am UTC](https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269/4 "2022-03-18T05:55:36Z")

</div>

Because that’s the way it’s implemented. Autoplay can be annoying and a security issue.

---

<div class="post-metadata">

**Author:** ![DC0L0N](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DC0L0N](https://forum.codewithmosh.com/u/DC0L0N)\
**Post date:** [December 30, 2022, 8:37am UTC](https://forum.codewithmosh.com/t/autoplay-attribute-doesnt-work/11269/5 "2022-12-30T08:37:32Z")

</div>

It actually works, but the browser blocks the autoplay for security purposes.  
You could make a white list for the website you working on it throw the settings.
