# Should audio and video tags be allowed?

**URL:** <https://meta.discourse.org/t/should-audio-and-video-tags-be-allowed/12709>\
**Category:** Feature\
**Created:** [2014 年2 月 14 日 04:35 UTC](https://meta.discourse.org/t/should-audio-and-video-tags-be-allowed/12709 "2014-02-14T04:35:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
发布日期： [2014 年2 月 14 日 04:36 UTC](https://meta.discourse.org/t/should-audio-and-video-tags-be-allowed/12709/1 "2014-02-14T04:36:00Z")

</div>

I was just [going over the html sanitizer whitelist](https://github.com/discourse/discourse/pull/1948) and wasn’t sure what to do about `<audio>` and `<video>`.

It seems that they do, in fact, work, but only if you specify `src=` in the audio tag, not in source tags.

This works:

```plaintext
<audio controls autoplay src="https://wiki.teamfortress.com/w/images/6/6c/Spy_DominationDemoMan07.wav?t=20100625234555"></audio>
<video controls autoplay loop src="https://tehurn.com/media/LUIGI_9001_SUPER_SWAGG_XXXX.mp4" >

```

> **Click to expand the audio/video**
>

(TF2 Spy voice reaction and end of Luigi’s Mansion plus Twitch chat jokes on top of Numa Numa, respectively.)

But this doesn’t:

```plaintext
<video controls autoplay>
  <source src="https://wiki.teamfortress.com/w/images/e/e9/Spy_specialcompleted04.wav?t=20100625234706" type="audio/x-wav">
</video>
<video autoplay loop>
  <source src="https://tehurn.com/media/LUIGI_9001_SUPER_SWAGG_XXXX.webm" type="video/webm">
  <source src="https://tehurn.com/media/LUIGI_9001_SUPER_SWAGG_XXXX.mp4" type="video/mp4">
</video>

```

What to do?

Also note that “autoplay” doesn’t actually do anything on a Discourse site.

---

_[View the full topic](https://meta.discourse.org/t/should-audio-and-video-tags-be-allowed/12709)._
