tagName); if ($tagName !== 'video' && $tagName !== 'audio') { return null; } if ($element->hasAttribute('autoplay')) { // If autoplay is active, it must be muted to be acceptable if (!$element->hasAttribute('muted')) { return $this->createViolation( $element, $this->getDescription(), 'Remove the autoplay attribute, or add the muted attribute to prevent the media from playing sound automatically.' ); } } return null; } }