When embedding videos or other media elements on a page, the <iframe>
html tag must have a text alternative in the form of a title
or aria-label
attribute. Often, embed code will include an appropriate title attibute. For example, this embed code copied from YouTube:
<iframe width="560" height="315" src="https://www.youtube.com/embed/TgLDzaO4Vao" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
While a generic title is acceptable, it is best practice to give it a unique title describing the video. If there are multiple iframes embedded in a page, then each iframe must have a unique title.
A correctly embedded YouTube video with a text alternative. The iframe embed tag has a title attribute with a value of "Dr. Wendler Video".
An incorrectly embedded YouTube video without a text alternative. The iframe embed tag has no title attribute.
Another incorrectly embedded YouTube video without a text alternative. The iframe embed tag has no title attribute.